hcloud-sdk 17.0.0 → 18.0.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/changelog.md +176 -76
- package/lib/Base.d.ts +2 -1
- package/lib/Hcloud.d.ts +6 -3
- package/lib/Hcloud.js +16 -5
- package/lib/helper/ValidationHelper.d.ts +10 -2
- package/lib/helper/ValidationHelper.js +55 -7
- package/lib/interfaces/auditor/index.d.ts +13 -2
- package/lib/interfaces/auditor/index.js +9 -1
- package/lib/interfaces/cosmo/asset/index.d.ts +185 -0
- package/lib/interfaces/cosmo/asset/index.js +82 -0
- package/lib/interfaces/cosmo/comment/index.d.ts +38 -0
- package/lib/interfaces/cosmo/comment/index.js +8 -0
- package/lib/interfaces/cosmo/event/index.d.ts +31 -0
- package/lib/interfaces/cosmo/event/index.js +17 -0
- package/lib/interfaces/cosmo/location/index.d.ts +4 -0
- package/lib/interfaces/cosmo/namespace/index.d.ts +9 -0
- package/lib/interfaces/cosmo/namespace/index.js +9 -0
- package/lib/interfaces/cosmo/permissions.d.ts +96 -0
- package/lib/interfaces/cosmo/permissions.js +58 -0
- package/lib/interfaces/cosmo/share/index.d.ts +28 -0
- package/lib/interfaces/cosmo/share/index.js +2 -0
- package/lib/interfaces/cosmo/space/index.d.ts +25 -0
- package/lib/interfaces/cosmo/space/index.js +2 -0
- package/lib/interfaces/cosmo/tag/tag.d.ts +12 -0
- package/lib/interfaces/cosmo/tag/tag.js +2 -0
- package/lib/interfaces/global/Products.d.ts +2 -2
- package/lib/interfaces/global/Products.js +1 -1
- package/lib/interfaces/high5/index.d.ts +7 -7
- package/lib/interfaces/high5/index.js +7 -7
- package/lib/interfaces/{friday → high5}/space/database/document/index.d.ts +1 -1
- package/lib/interfaces/{friday → high5}/space/database/document/index.js +2 -1
- package/lib/interfaces/high5/space/database/index.js +2 -0
- package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +9 -2
- package/lib/interfaces/high5/space/execution/index.d.ts +2 -1
- package/lib/interfaces/high5/space/job/JobLog.d.ts +16 -0
- package/lib/interfaces/high5/space/job/JobLog.js +2 -0
- package/lib/interfaces/high5/space/job/index.d.ts +38 -0
- package/lib/interfaces/high5/space/job/index.js +8 -0
- package/lib/interfaces/high5/stats.d.ts +21 -0
- package/lib/interfaces/high5/stats.js +2 -0
- package/lib/interfaces/idp/oauth/index.d.ts +4 -3
- package/lib/interfaces/idp/organization/index.d.ts +1 -0
- package/lib/interfaces/idp/organization/index.js +1 -0
- package/lib/interfaces/idp/organization/license/index.d.ts +13 -11
- package/lib/interfaces/idp/organization/member/index.d.ts +1 -0
- package/lib/interfaces/idp/organization/stats.d.ts +7 -0
- package/lib/interfaces/idp/organization/stats.js +2 -0
- package/lib/interfaces/idp/organization/team/index.d.ts +0 -1
- package/lib/interfaces/idp/user/Message.d.ts +21 -0
- package/lib/interfaces/idp/user/Message.js +14 -0
- package/lib/interfaces/idp/user/NotificationSettings.d.ts +1 -0
- package/lib/interfaces/idp/user/Scopes.d.ts +1 -7
- package/lib/interfaces/idp/user/Scopes.js +0 -9
- package/lib/interfaces/idp/user/index.d.ts +2 -1
- package/lib/interfaces/mailer/index.d.ts +30 -1
- package/lib/interfaces/mailer/index.js +87 -1
- package/lib/interfaces/mothership/index.d.ts +3 -1
- package/lib/interfaces/mothership/index.js +15 -0
- package/lib/interfaces/mothership/stats.d.ts +4 -0
- package/lib/interfaces/mothership/stats.js +2 -0
- package/lib/interfaces/nats/index.d.ts +54 -24
- package/lib/interfaces/nats/index.js +87 -58
- package/lib/interfaces/shorts/index.d.ts +10 -0
- package/lib/interfaces/shorts/index.js +2 -0
- package/lib/service/agent/bundle/dev/index.d.ts +16 -6
- package/lib/service/agent/bundle/dev/index.js +12 -10
- package/lib/service/agent/bundle/index.d.ts +10 -4
- package/lib/service/agent/bundle/index.js +6 -6
- package/lib/service/agent/context/index.d.ts +22 -8
- package/lib/service/agent/context/index.js +15 -14
- package/lib/service/auditor/index.d.ts +8 -4
- package/lib/service/auditor/index.js +5 -5
- package/lib/service/auditor/internal/index.d.ts +27 -3
- package/lib/service/auditor/internal/index.js +34 -5
- package/lib/service/bouncer/features/index.d.ts +4 -2
- package/lib/service/bouncer/features/index.js +2 -2
- package/lib/service/cosmo/asset/index.d.ts +219 -0
- package/lib/service/cosmo/asset/index.js +314 -0
- package/lib/service/cosmo/comment/index.d.ts +122 -0
- package/lib/service/cosmo/comment/index.js +161 -0
- package/lib/service/cosmo/event/index.d.ts +23 -0
- package/lib/service/cosmo/event/index.js +40 -0
- package/lib/service/cosmo/folder/index.d.ts +27 -0
- package/lib/service/cosmo/folder/index.js +47 -0
- package/lib/service/cosmo/index.d.ts +49 -0
- package/lib/service/cosmo/index.js +119 -0
- package/lib/service/cosmo/internal/index.d.ts +7 -0
- package/lib/service/cosmo/internal/index.js +17 -0
- package/lib/service/cosmo/internal/space/index.d.ts +15 -0
- package/lib/service/cosmo/internal/space/index.js +34 -0
- package/lib/service/cosmo/location/index.d.ts +40 -0
- package/lib/service/cosmo/location/index.js +63 -0
- package/lib/service/cosmo/namespace/index.d.ts +42 -0
- package/lib/service/cosmo/namespace/index.js +65 -0
- package/lib/service/cosmo/organization/index.d.ts +47 -0
- package/lib/service/cosmo/organization/index.js +64 -0
- package/lib/service/cosmo/permissions/index.d.ts +131 -0
- package/lib/service/cosmo/permissions/index.js +181 -0
- package/lib/service/cosmo/production/index.d.ts +26 -0
- package/lib/service/cosmo/production/index.js +45 -0
- package/lib/service/cosmo/share/index.d.ts +161 -0
- package/lib/service/cosmo/share/index.js +215 -0
- package/lib/service/cosmo/space/index.d.ts +104 -0
- package/lib/service/cosmo/space/index.js +146 -0
- package/lib/service/cosmo/tag/index.d.ts +67 -0
- package/lib/service/cosmo/tag/index.js +93 -0
- package/lib/service/dali/avatar/DaliCosmoSpace.d.ts +10 -4
- package/lib/service/dali/avatar/DaliCosmoSpace.js +8 -7
- package/lib/service/dali/avatar/DaliFuseSpace.d.ts +10 -4
- package/lib/service/dali/avatar/DaliFuseSpace.js +7 -6
- package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +10 -4
- package/lib/service/dali/avatar/DaliHigh5Pool.js +7 -6
- package/lib/service/dali/avatar/DaliHigh5Space.d.ts +10 -4
- package/lib/service/dali/avatar/DaliHigh5Space.js +7 -6
- package/lib/service/dali/avatar/DaliOAuthApp.d.ts +10 -4
- package/lib/service/dali/avatar/DaliOAuthApp.js +7 -6
- package/lib/service/dali/avatar/DaliOrganization.d.ts +10 -4
- package/lib/service/dali/avatar/DaliOrganization.js +7 -6
- package/lib/service/dali/avatar/DaliServiceAccount.d.ts +10 -4
- package/lib/service/dali/avatar/DaliServiceAccount.js +7 -6
- package/lib/service/dali/avatar/DaliTeam.d.ts +10 -4
- package/lib/service/dali/avatar/DaliTeam.js +7 -6
- package/lib/service/dali/avatar/DaliUser.d.ts +10 -4
- package/lib/service/dali/avatar/DaliUser.js +7 -6
- package/lib/service/dali/index.d.ts +4 -5
- package/lib/service/dali/index.js +2 -5
- package/lib/service/fuse/index.d.ts +4 -2
- package/lib/service/fuse/index.js +2 -2
- package/lib/service/fuse/internal/index.d.ts +4 -2
- package/lib/service/fuse/internal/index.js +3 -2
- package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +4 -2
- package/lib/service/fuse/internal/space/cronjob/log/index.js +2 -2
- package/lib/service/fuse/internal/space/index.d.ts +7 -3
- package/lib/service/fuse/internal/space/index.js +6 -4
- package/lib/service/fuse/space/cronjob/index.d.ts +35 -13
- package/lib/service/fuse/space/cronjob/index.js +48 -50
- package/lib/service/fuse/space/cronjob/log/index.d.ts +8 -4
- package/lib/service/fuse/space/cronjob/log/index.js +5 -5
- package/lib/service/fuse/space/index.d.ts +27 -11
- package/lib/service/fuse/space/index.js +19 -18
- package/lib/service/high5/execution/index.d.ts +4 -2
- package/lib/service/high5/execution/index.js +3 -2
- package/lib/service/high5/execution/status/index.d.ts +5 -3
- package/lib/service/high5/execution/status/index.js +3 -3
- package/lib/service/high5/index.d.ts +7 -2
- package/lib/service/high5/index.js +9 -2
- package/lib/service/high5/internal/index.d.ts +4 -2
- package/lib/service/high5/internal/index.js +3 -2
- package/lib/service/high5/internal/space/index.d.ts +10 -3
- package/lib/service/high5/internal/space/index.js +13 -4
- package/lib/service/high5/internal/space/job/index.d.ts +7 -0
- package/lib/service/high5/internal/space/job/index.js +17 -0
- package/lib/service/high5/internal/space/job/log/index.d.ts +17 -0
- package/lib/service/high5/internal/space/job/log/index.js +34 -0
- package/lib/service/high5/joinToken/index.d.ts +14 -6
- package/lib/service/high5/joinToken/index.js +10 -9
- package/lib/service/high5/space/database/document/array/index.d.ts +73 -0
- package/lib/service/high5/space/database/document/array/index.js +102 -0
- package/lib/service/{friday → high5}/space/database/document/index.d.ts +26 -10
- package/lib/service/{friday → high5}/space/database/document/index.js +31 -16
- package/lib/service/high5/space/database/document/number/index.d.ts +51 -0
- package/lib/service/high5/space/database/document/number/index.js +77 -0
- package/lib/service/{friday → high5}/space/database/index.d.ts +22 -12
- package/lib/service/{friday → high5}/space/database/index.js +18 -17
- package/lib/service/high5/space/event/index.d.ts +17 -7
- package/lib/service/high5/space/event/index.js +12 -11
- package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +4 -2
- package/lib/service/high5/space/event/stream/design/DesignOperations.js +2 -2
- package/lib/service/high5/space/event/stream/design/index.d.ts +10 -4
- package/lib/service/high5/space/event/stream/design/index.js +7 -6
- package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +16 -6
- package/lib/service/high5/space/event/stream/design/snapshot/index.js +12 -10
- package/lib/service/high5/space/event/stream/index.d.ts +32 -12
- package/lib/service/high5/space/event/stream/index.js +22 -21
- package/lib/service/high5/space/execution/index.d.ts +19 -7
- package/lib/service/high5/space/execution/index.js +17 -12
- package/lib/service/high5/space/execution/log/index.d.ts +8 -4
- package/lib/service/high5/space/execution/log/index.js +5 -5
- package/lib/service/high5/space/execution/status/index.d.ts +7 -3
- package/lib/service/high5/space/execution/status/index.js +4 -4
- package/lib/service/high5/space/index.d.ts +43 -14
- package/lib/service/high5/space/index.js +45 -23
- package/lib/service/high5/space/job/index.d.ts +145 -0
- package/lib/service/high5/space/job/index.js +201 -0
- package/lib/service/high5/space/job/log/index.d.ts +35 -0
- package/lib/service/high5/space/job/log/index.js +58 -0
- package/lib/service/high5/space/node/index.d.ts +20 -8
- package/lib/service/high5/space/node/index.js +14 -13
- package/lib/service/high5/space/pool/index.d.ts +27 -11
- package/lib/service/high5/space/pool/index.js +19 -18
- package/lib/service/high5/space/secret/index.d.ts +17 -7
- package/lib/service/high5/space/secret/index.js +12 -11
- package/lib/service/high5/space/stat/index.d.ts +12 -0
- package/lib/service/high5/space/stat/index.js +31 -0
- package/lib/service/high5/space/wave/index.d.ts +16 -6
- package/lib/service/high5/space/wave/index.js +11 -10
- package/lib/service/high5/space/webhook/index.d.ts +32 -12
- package/lib/service/high5/space/webhook/index.js +25 -21
- package/lib/service/high5/space/webhook/log/index.d.ts +4 -2
- package/lib/service/high5/space/webhook/log/index.js +2 -2
- package/lib/service/high5/stat/index.d.ts +11 -0
- package/lib/service/high5/stat/index.js +30 -0
- package/lib/service/high5/wave/s3/index.d.ts +31 -8
- package/lib/service/high5/wave/s3/index.js +42 -21
- package/lib/service/idp/guest/index.d.ts +42 -0
- package/lib/service/idp/guest/index.js +66 -0
- package/lib/service/idp/index.d.ts +25 -7
- package/lib/service/idp/index.js +23 -12
- package/lib/service/idp/internal/index.d.ts +5 -3
- package/lib/service/idp/internal/index.js +5 -3
- package/lib/service/idp/oauth/index.d.ts +16 -6
- package/lib/service/idp/oauth/index.js +15 -15
- package/lib/service/idp/organization/index.d.ts +19 -5
- package/lib/service/idp/organization/index.js +19 -8
- package/lib/service/idp/organization/license/index.d.ts +7 -3
- package/lib/service/idp/organization/license/index.js +4 -4
- package/lib/service/idp/organization/member/index.d.ts +20 -8
- package/lib/service/idp/organization/member/index.js +15 -13
- package/lib/service/idp/organization/member/invitations/index.d.ts +23 -9
- package/lib/service/idp/organization/member/invitations/index.js +72 -59
- package/lib/service/idp/organization/service-accounts/index.d.ts +20 -8
- package/lib/service/idp/organization/service-accounts/index.js +13 -12
- package/lib/service/idp/organization/settings/domain/index.d.ts +13 -5
- package/lib/service/idp/organization/settings/domain/index.js +9 -8
- package/lib/service/idp/organization/settings/domain/saml/index.d.ts +16 -6
- package/lib/service/idp/organization/settings/domain/saml/index.js +19 -18
- package/lib/service/idp/organization/settings/oauth/index.d.ts +23 -9
- package/lib/service/idp/organization/settings/oauth/index.js +16 -15
- package/lib/service/idp/organization/stat/index.d.ts +11 -0
- package/lib/service/idp/organization/stat/index.js +30 -0
- package/lib/service/idp/organization/team/index.d.ts +22 -10
- package/lib/service/idp/organization/team/index.js +14 -13
- package/lib/service/idp/registration/index.d.ts +10 -4
- package/lib/service/idp/registration/index.js +15 -9
- package/lib/service/idp/user/index.d.ts +33 -11
- package/lib/service/idp/user/index.js +29 -16
- package/lib/service/idp/user/license/index.d.ts +7 -3
- package/lib/service/idp/user/license/index.js +4 -4
- package/lib/service/idp/user/message/index.d.ts +61 -0
- package/lib/service/idp/user/message/index.js +92 -0
- package/lib/service/idp/user/password/index.d.ts +4 -2
- package/lib/service/idp/user/password/index.js +2 -2
- package/lib/service/idp/user/settings/connections/index.d.ts +4 -2
- package/lib/service/idp/user/settings/connections/index.js +2 -2
- package/lib/service/idp/user/settings/general/index.d.ts +10 -4
- package/lib/service/idp/user/settings/general/index.js +6 -6
- package/lib/service/idp/user/settings/notifications/index.d.ts +7 -3
- package/lib/service/idp/user/settings/notifications/index.js +4 -4
- package/lib/service/idp/user/settings/oauthApps/index.d.ts +7 -3
- package/lib/service/idp/user/settings/oauthApps/index.js +6 -5
- package/lib/service/idp/user/settings/pats/index.d.ts +22 -8
- package/lib/service/idp/user/settings/pats/index.js +17 -15
- package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +16 -6
- package/lib/service/idp/user/settings/twoFactor/totp/index.js +13 -10
- package/lib/service/mailer/index.d.ts +4 -2
- package/lib/service/mailer/index.js +2 -2
- package/lib/service/mailer/internal/index.d.ts +13 -5
- package/lib/service/mailer/internal/index.js +8 -8
- package/lib/service/mothership/index.d.ts +35 -13
- package/lib/service/mothership/index.js +32 -17
- package/lib/service/nats/index.js +58 -43
- package/lib/service/shorts/index.d.ts +18 -0
- package/lib/service/{friday → shorts}/index.js +13 -10
- package/lib/service/shorts/internal/index.d.ts +72 -0
- package/lib/service/shorts/internal/index.js +104 -0
- package/package.json +1 -1
- package/lib/interfaces/friday/index.d.ts +0 -3
- package/lib/interfaces/friday/index.js +0 -19
- package/lib/interfaces/friday/space/index.d.ts +0 -21
- package/lib/interfaces/friday/space/index.js +0 -11
- package/lib/service/friday/index.d.ts +0 -13
- package/lib/service/friday/space/index.d.ts +0 -81
- package/lib/service/friday/space/index.js +0 -150
- /package/lib/interfaces/{friday/space/database → cosmo/location}/index.js +0 -0
- /package/lib/interfaces/{friday → high5}/space/database/index.d.ts +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../../../../Base";
|
|
2
|
+
import { PaginatedResponse, SearchParams } from "../../../../../../interfaces/global";
|
|
3
|
+
import { Document } from "../../../../../../interfaces/high5";
|
|
4
|
+
export declare class High5DocumentArray extends Base {
|
|
5
|
+
/**
|
|
6
|
+
* Retrieves all items of a specified array document which match the provided search filter(s). Will return all items of the array if no filter is provided.
|
|
7
|
+
* @param orgName Name of the Organization
|
|
8
|
+
* @param spaceName Name of the Space
|
|
9
|
+
* @param dbName Name of the Database
|
|
10
|
+
* @param key Key of the Document (it should be document with Array<object>)
|
|
11
|
+
* @param filters (optional) Array of search filters
|
|
12
|
+
* @param sorting (optional) Sorting object
|
|
13
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
14
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
15
|
+
* @returns Object containing an array of items and the total number of results found in the document (independent of limit and page)
|
|
16
|
+
*/
|
|
17
|
+
searchItems<R extends boolean = false>({ orgName, spaceName, dbName, key, filters, sorting, limit, page, }: SearchParams & {
|
|
18
|
+
orgName: string;
|
|
19
|
+
spaceName: string;
|
|
20
|
+
dbName: string;
|
|
21
|
+
key: string;
|
|
22
|
+
}, raw?: {
|
|
23
|
+
raw: R;
|
|
24
|
+
}): Promise<MaybeRaw<R, PaginatedResponse<object>>>;
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves an array item by its index.
|
|
27
|
+
* @param orgName Name of the Organization
|
|
28
|
+
* @param spaceName Name of the Space
|
|
29
|
+
* @param dbName Name of the Database
|
|
30
|
+
* @param key Key of the Document
|
|
31
|
+
* @param index Index of the arrays item
|
|
32
|
+
* @returns The requested item of the array
|
|
33
|
+
*/
|
|
34
|
+
getItem<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, key: string, index: number, raw?: {
|
|
35
|
+
raw: R;
|
|
36
|
+
}): Promise<MaybeRaw<R, object>>;
|
|
37
|
+
/**
|
|
38
|
+
* Deletes an item of the specified array by its index.
|
|
39
|
+
* @param orgName Name of the Organization
|
|
40
|
+
* @param spaceName Name of the Space
|
|
41
|
+
* @param dbName Name of the Database
|
|
42
|
+
* @param key Key of the Document
|
|
43
|
+
* @param index Index of the item of the array
|
|
44
|
+
*/
|
|
45
|
+
deleteItem<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, key: string, index: number, raw?: {
|
|
46
|
+
raw: R;
|
|
47
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
48
|
+
/**
|
|
49
|
+
* Pushes a list of items to the end of the specified array document.
|
|
50
|
+
* @param orgName Name of the Organization
|
|
51
|
+
* @param spaceName Name of the Space
|
|
52
|
+
* @param dbName Name of the Database
|
|
53
|
+
* @param key Key of the Document
|
|
54
|
+
* @param items New array items to be added to the end of the specified array document
|
|
55
|
+
* @returns Updated Document
|
|
56
|
+
*/
|
|
57
|
+
pushItems<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, key: string, items: Array<unknown>, raw?: {
|
|
58
|
+
raw: R;
|
|
59
|
+
}): Promise<MaybeRaw<R, Document>>;
|
|
60
|
+
/**
|
|
61
|
+
* Unshifts a list of items to the beginning of the specified array document.
|
|
62
|
+
* @param orgName Name of the Organization
|
|
63
|
+
* @param spaceName Name of the Space
|
|
64
|
+
* @param dbName Name of the Database
|
|
65
|
+
* @param key Key of the Document
|
|
66
|
+
* @param items New array items to be inserted to the beginning of the specified array document
|
|
67
|
+
* @returns Updated Document
|
|
68
|
+
*/
|
|
69
|
+
unshiftItems<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, key: string, items: Array<unknown>, raw?: {
|
|
70
|
+
raw: R;
|
|
71
|
+
}): Promise<MaybeRaw<R, Document>>;
|
|
72
|
+
protected getEndpoint(endpoint: string): string;
|
|
73
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.High5DocumentArray = void 0;
|
|
13
|
+
const Base_1 = require("../../../../../../Base");
|
|
14
|
+
const paginatedResponseHelper_1 = require("../../../../../../helper/paginatedResponseHelper");
|
|
15
|
+
const searchFilter_1 = require("../../../../../../helper/searchFilter");
|
|
16
|
+
class High5DocumentArray extends Base_1.default {
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves all items of a specified array document which match the provided search filter(s). Will return all items of the array if no filter is provided.
|
|
19
|
+
* @param orgName Name of the Organization
|
|
20
|
+
* @param spaceName Name of the Space
|
|
21
|
+
* @param dbName Name of the Database
|
|
22
|
+
* @param key Key of the Document (it should be document with Array<object>)
|
|
23
|
+
* @param filters (optional) Array of search filters
|
|
24
|
+
* @param sorting (optional) Sorting object
|
|
25
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
26
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
27
|
+
* @returns Object containing an array of items and the total number of results found in the document (independent of limit and page)
|
|
28
|
+
*/
|
|
29
|
+
searchItems(_a, raw_1) {
|
|
30
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, dbName, key, filters, sorting, limit = 25, page = 0, }, raw) {
|
|
31
|
+
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
|
|
32
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}/search?page=${page}&limit=${limit}`), {
|
|
33
|
+
filters: filtersDTO,
|
|
34
|
+
sorting: sorting,
|
|
35
|
+
});
|
|
36
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves an array item by its index.
|
|
41
|
+
* @param orgName Name of the Organization
|
|
42
|
+
* @param spaceName Name of the Space
|
|
43
|
+
* @param dbName Name of the Database
|
|
44
|
+
* @param key Key of the Document
|
|
45
|
+
* @param index Index of the arrays item
|
|
46
|
+
* @returns The requested item of the array
|
|
47
|
+
*/
|
|
48
|
+
getItem(orgName, spaceName, dbName, key, index, raw) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}/index/${index}`));
|
|
51
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Deletes an item of the specified array by its index.
|
|
56
|
+
* @param orgName Name of the Organization
|
|
57
|
+
* @param spaceName Name of the Space
|
|
58
|
+
* @param dbName Name of the Database
|
|
59
|
+
* @param key Key of the Document
|
|
60
|
+
* @param index Index of the item of the array
|
|
61
|
+
*/
|
|
62
|
+
deleteItem(orgName, spaceName, dbName, key, index, raw) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}/index/${index}`));
|
|
65
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Pushes a list of items to the end of the specified array document.
|
|
70
|
+
* @param orgName Name of the Organization
|
|
71
|
+
* @param spaceName Name of the Space
|
|
72
|
+
* @param dbName Name of the Database
|
|
73
|
+
* @param key Key of the Document
|
|
74
|
+
* @param items New array items to be added to the end of the specified array document
|
|
75
|
+
* @returns Updated Document
|
|
76
|
+
*/
|
|
77
|
+
pushItems(orgName, spaceName, dbName, key, items, raw) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}/push`), { value: items });
|
|
80
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Unshifts a list of items to the beginning of the specified array document.
|
|
85
|
+
* @param orgName Name of the Organization
|
|
86
|
+
* @param spaceName Name of the Space
|
|
87
|
+
* @param dbName Name of the Database
|
|
88
|
+
* @param key Key of the Document
|
|
89
|
+
* @param items New array items to be inserted to the beginning of the specified array document
|
|
90
|
+
* @returns Updated Document
|
|
91
|
+
*/
|
|
92
|
+
unshiftItems(orgName, spaceName, dbName, key, items, raw) {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}/unshift`), { value: items });
|
|
95
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
getEndpoint(endpoint) {
|
|
99
|
+
return `${this.options.server}/api/high5${endpoint}`;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.High5DocumentArray = High5DocumentArray;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import Base from "../../../../../Base";
|
|
2
|
-
import { Document, DocumentCreateDto, DocumentPatchDto } from "../../../../../interfaces/friday";
|
|
1
|
+
import Base, { MaybeRaw } from "../../../../../Base";
|
|
3
2
|
import { PaginatedResponse, SearchParams } from "../../../../../interfaces/global";
|
|
4
|
-
|
|
3
|
+
import { Document, DocumentCreateDto, DocumentPatchDto } from "../../../../../interfaces/high5";
|
|
4
|
+
import { High5DocumentArray } from "./array";
|
|
5
|
+
import { High5DocumentNumber } from "./number";
|
|
6
|
+
export declare class High5Document extends Base {
|
|
7
|
+
get number(): High5DocumentNumber;
|
|
8
|
+
private _number?;
|
|
9
|
+
get array(): High5DocumentArray;
|
|
10
|
+
private _array?;
|
|
5
11
|
/**
|
|
6
|
-
* Retrieves all Documents of a
|
|
12
|
+
* Retrieves all Documents of a High5 Database which match the provided search filter(s). Will return all Documents of the Database if no filter is provided.
|
|
7
13
|
* @param orgName Name of the Organization
|
|
8
14
|
* @param spaceName Name of the Space
|
|
9
15
|
* @param dbName Name of the Database
|
|
@@ -13,11 +19,13 @@ export declare class FridayDocument extends Base {
|
|
|
13
19
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
14
20
|
* @returns Object containing an array of Documents and the total number of results found in the database (independent of limit and page)
|
|
15
21
|
*/
|
|
16
|
-
|
|
22
|
+
searchDocuments<R extends boolean = false>({ orgName, spaceName, dbName, filters, sorting, limit, page }: SearchParams & {
|
|
17
23
|
orgName: string;
|
|
18
24
|
spaceName: string;
|
|
19
25
|
dbName: string;
|
|
20
|
-
}
|
|
26
|
+
}, raw?: {
|
|
27
|
+
raw: R;
|
|
28
|
+
}): Promise<MaybeRaw<R, PaginatedResponse<Document>>>;
|
|
21
29
|
/**
|
|
22
30
|
* Retrieves a Document by its name.
|
|
23
31
|
* @param orgName Name of the Organization
|
|
@@ -26,7 +34,9 @@ export declare class FridayDocument extends Base {
|
|
|
26
34
|
* @param key Key of the Document
|
|
27
35
|
* @returns The requested Document
|
|
28
36
|
*/
|
|
29
|
-
getDocument(orgName: string, spaceName: string, dbName: string, key: string
|
|
37
|
+
getDocument<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, key: string, raw?: {
|
|
38
|
+
raw: R;
|
|
39
|
+
}): Promise<MaybeRaw<R, Document>>;
|
|
30
40
|
/**
|
|
31
41
|
* Creates a new Document in the provided Database.
|
|
32
42
|
* @param orgName Name of the Organization
|
|
@@ -35,7 +45,9 @@ export declare class FridayDocument extends Base {
|
|
|
35
45
|
* @param document New document details
|
|
36
46
|
* @returns The created Document
|
|
37
47
|
*/
|
|
38
|
-
createDocument(orgName: string, spaceName: string, dbName: string, document: DocumentCreateDto
|
|
48
|
+
createDocument<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, document: DocumentCreateDto, raw?: {
|
|
49
|
+
raw: R;
|
|
50
|
+
}): Promise<MaybeRaw<R, Document>>;
|
|
39
51
|
/**
|
|
40
52
|
* Update existing Document
|
|
41
53
|
* @param orgName Name of the Organization
|
|
@@ -45,7 +57,9 @@ export declare class FridayDocument extends Base {
|
|
|
45
57
|
* @param document New value to update the Document
|
|
46
58
|
* @returns Updated Document
|
|
47
59
|
*/
|
|
48
|
-
updateDocument(orgName: string, spaceName: string, dbName: string, key: string, document: DocumentPatchDto
|
|
60
|
+
updateDocument<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, key: string, document: DocumentPatchDto, raw?: {
|
|
61
|
+
raw: R;
|
|
62
|
+
}): Promise<MaybeRaw<R, Document>>;
|
|
49
63
|
/**
|
|
50
64
|
* Deletes a Document by its key.
|
|
51
65
|
* @param orgName Name of the Organization
|
|
@@ -53,6 +67,8 @@ export declare class FridayDocument extends Base {
|
|
|
53
67
|
* @param dbName Name of the Database
|
|
54
68
|
* @param key Key of the Document
|
|
55
69
|
*/
|
|
56
|
-
deleteDocument(orgName: string, spaceName: string, dbName: string, key: string
|
|
70
|
+
deleteDocument<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, key: string, raw?: {
|
|
71
|
+
raw: R;
|
|
72
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
57
73
|
protected getEndpoint(endpoint: string): string;
|
|
58
74
|
}
|
|
@@ -9,13 +9,27 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.High5Document = void 0;
|
|
13
13
|
const Base_1 = require("../../../../../Base");
|
|
14
14
|
const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
|
|
15
15
|
const searchFilter_1 = require("../../../../../helper/searchFilter");
|
|
16
|
-
|
|
16
|
+
const array_1 = require("./array");
|
|
17
|
+
const number_1 = require("./number");
|
|
18
|
+
class High5Document extends Base_1.default {
|
|
19
|
+
get number() {
|
|
20
|
+
if (this._number === undefined) {
|
|
21
|
+
this._number = new number_1.High5DocumentNumber(this.options, this.axios);
|
|
22
|
+
}
|
|
23
|
+
return this._number;
|
|
24
|
+
}
|
|
25
|
+
get array() {
|
|
26
|
+
if (this._array === undefined) {
|
|
27
|
+
this._array = new array_1.High5DocumentArray(this.options, this.axios);
|
|
28
|
+
}
|
|
29
|
+
return this._array;
|
|
30
|
+
}
|
|
17
31
|
/**
|
|
18
|
-
* Retrieves all Documents of a
|
|
32
|
+
* Retrieves all Documents of a High5 Database which match the provided search filter(s). Will return all Documents of the Database if no filter is provided.
|
|
19
33
|
* @param orgName Name of the Organization
|
|
20
34
|
* @param spaceName Name of the Space
|
|
21
35
|
* @param dbName Name of the Database
|
|
@@ -25,14 +39,14 @@ class FridayDocument extends Base_1.default {
|
|
|
25
39
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
26
40
|
* @returns Object containing an array of Documents and the total number of results found in the database (independent of limit and page)
|
|
27
41
|
*/
|
|
28
|
-
|
|
29
|
-
return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, dbName, filters, sorting, limit = 25, page = 0,
|
|
42
|
+
searchDocuments(_a, raw_1) {
|
|
43
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, dbName, filters, sorting, limit = 25, page = 0 }, raw) {
|
|
30
44
|
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
|
|
31
45
|
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/search?page=${page}&limit=${limit}`), {
|
|
32
46
|
filters: filtersDTO,
|
|
33
47
|
sorting: sorting,
|
|
34
48
|
});
|
|
35
|
-
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
49
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
|
|
36
50
|
});
|
|
37
51
|
}
|
|
38
52
|
/**
|
|
@@ -43,10 +57,10 @@ class FridayDocument extends Base_1.default {
|
|
|
43
57
|
* @param key Key of the Document
|
|
44
58
|
* @returns The requested Document
|
|
45
59
|
*/
|
|
46
|
-
getDocument(orgName, spaceName, dbName, key) {
|
|
60
|
+
getDocument(orgName, spaceName, dbName, key, raw) {
|
|
47
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
62
|
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}`));
|
|
49
|
-
return resp.data;
|
|
63
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
50
64
|
});
|
|
51
65
|
}
|
|
52
66
|
/**
|
|
@@ -57,10 +71,10 @@ class FridayDocument extends Base_1.default {
|
|
|
57
71
|
* @param document New document details
|
|
58
72
|
* @returns The created Document
|
|
59
73
|
*/
|
|
60
|
-
createDocument(orgName, spaceName, dbName, document) {
|
|
74
|
+
createDocument(orgName, spaceName, dbName, document, raw) {
|
|
61
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
62
76
|
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents`), document);
|
|
63
|
-
return resp.data;
|
|
77
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
64
78
|
});
|
|
65
79
|
}
|
|
66
80
|
/**
|
|
@@ -72,10 +86,10 @@ class FridayDocument extends Base_1.default {
|
|
|
72
86
|
* @param document New value to update the Document
|
|
73
87
|
* @returns Updated Document
|
|
74
88
|
*/
|
|
75
|
-
updateDocument(orgName, spaceName, dbName, key, document) {
|
|
89
|
+
updateDocument(orgName, spaceName, dbName, key, document, raw) {
|
|
76
90
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
91
|
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}`), document);
|
|
78
|
-
return resp.data;
|
|
92
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
79
93
|
});
|
|
80
94
|
}
|
|
81
95
|
/**
|
|
@@ -85,13 +99,14 @@ class FridayDocument extends Base_1.default {
|
|
|
85
99
|
* @param dbName Name of the Database
|
|
86
100
|
* @param key Key of the Document
|
|
87
101
|
*/
|
|
88
|
-
deleteDocument(orgName, spaceName, dbName, key) {
|
|
102
|
+
deleteDocument(orgName, spaceName, dbName, key, raw) {
|
|
89
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}`));
|
|
104
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}`));
|
|
105
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
91
106
|
});
|
|
92
107
|
}
|
|
93
108
|
getEndpoint(endpoint) {
|
|
94
|
-
return `${this.options.server}/api/
|
|
109
|
+
return `${this.options.server}/api/high5${endpoint}`;
|
|
95
110
|
}
|
|
96
111
|
}
|
|
97
|
-
exports.
|
|
112
|
+
exports.High5Document = High5Document;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../../../../Base";
|
|
2
|
+
import { Document } from "../../../../../../interfaces/high5";
|
|
3
|
+
export declare class High5DocumentNumber extends Base {
|
|
4
|
+
/**
|
|
5
|
+
* Increments the current integer value by one.
|
|
6
|
+
* @param orgName Name of the Organization
|
|
7
|
+
* @param spaceName Name of the Space
|
|
8
|
+
* @param dbName Name of the Database
|
|
9
|
+
* @param key Key of the Document
|
|
10
|
+
* @returns Updated Document
|
|
11
|
+
*/
|
|
12
|
+
increment<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, key: string, raw?: {
|
|
13
|
+
raw: R;
|
|
14
|
+
}): Promise<MaybeRaw<R, Document>>;
|
|
15
|
+
/**
|
|
16
|
+
* Decrements the current integer value by one.
|
|
17
|
+
* @param orgName Name of the Organization
|
|
18
|
+
* @param spaceName Name of the Space
|
|
19
|
+
* @param dbName Name of the Database
|
|
20
|
+
* @param key Key of the Document
|
|
21
|
+
* @returns Updated Document
|
|
22
|
+
*/
|
|
23
|
+
decrement<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, key: string, raw?: {
|
|
24
|
+
raw: R;
|
|
25
|
+
}): Promise<MaybeRaw<R, Document>>;
|
|
26
|
+
/**
|
|
27
|
+
* Adds value to current numeric document value.
|
|
28
|
+
* @param orgName Name of the Organization
|
|
29
|
+
* @param spaceName Name of the Space
|
|
30
|
+
* @param dbName Name of the Database
|
|
31
|
+
* @param key Key of the Document
|
|
32
|
+
* @param value Value to be added
|
|
33
|
+
* @returns Updated Document
|
|
34
|
+
*/
|
|
35
|
+
add<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, key: string, value: number, raw?: {
|
|
36
|
+
raw: R;
|
|
37
|
+
}): Promise<MaybeRaw<R, Document>>;
|
|
38
|
+
/**
|
|
39
|
+
* Subtracts value from current numeric document value.
|
|
40
|
+
* @param orgName Name of the Organization
|
|
41
|
+
* @param spaceName Name of the Space
|
|
42
|
+
* @param dbName Name of the Database
|
|
43
|
+
* @param key Key of the Document
|
|
44
|
+
* @param value Value to be subtracted
|
|
45
|
+
* @returns Updated Document
|
|
46
|
+
*/
|
|
47
|
+
subtract<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, key: string, value: number, raw?: {
|
|
48
|
+
raw: R;
|
|
49
|
+
}): Promise<MaybeRaw<R, Document>>;
|
|
50
|
+
protected getEndpoint(endpoint: string): string;
|
|
51
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.High5DocumentNumber = void 0;
|
|
13
|
+
const Base_1 = require("../../../../../../Base");
|
|
14
|
+
class High5DocumentNumber extends Base_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Increments the current integer value by one.
|
|
17
|
+
* @param orgName Name of the Organization
|
|
18
|
+
* @param spaceName Name of the Space
|
|
19
|
+
* @param dbName Name of the Database
|
|
20
|
+
* @param key Key of the Document
|
|
21
|
+
* @returns Updated Document
|
|
22
|
+
*/
|
|
23
|
+
increment(orgName, spaceName, dbName, key, raw) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}/inc`));
|
|
26
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Decrements the current integer value by one.
|
|
31
|
+
* @param orgName Name of the Organization
|
|
32
|
+
* @param spaceName Name of the Space
|
|
33
|
+
* @param dbName Name of the Database
|
|
34
|
+
* @param key Key of the Document
|
|
35
|
+
* @returns Updated Document
|
|
36
|
+
*/
|
|
37
|
+
decrement(orgName, spaceName, dbName, key, raw) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}/dec`));
|
|
40
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Adds value to current numeric document value.
|
|
45
|
+
* @param orgName Name of the Organization
|
|
46
|
+
* @param spaceName Name of the Space
|
|
47
|
+
* @param dbName Name of the Database
|
|
48
|
+
* @param key Key of the Document
|
|
49
|
+
* @param value Value to be added
|
|
50
|
+
* @returns Updated Document
|
|
51
|
+
*/
|
|
52
|
+
add(orgName, spaceName, dbName, key, value, raw) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}/inc/${value}`));
|
|
55
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Subtracts value from current numeric document value.
|
|
60
|
+
* @param orgName Name of the Organization
|
|
61
|
+
* @param spaceName Name of the Space
|
|
62
|
+
* @param dbName Name of the Database
|
|
63
|
+
* @param key Key of the Document
|
|
64
|
+
* @param value Value to be subtracted
|
|
65
|
+
* @returns Updated Document
|
|
66
|
+
*/
|
|
67
|
+
subtract(orgName, spaceName, dbName, key, value, raw) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/databases/${dbName}/documents/${key}/dec/${value}`));
|
|
70
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
getEndpoint(endpoint) {
|
|
74
|
+
return `${this.options.server}/api/high5${endpoint}`;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.High5DocumentNumber = High5DocumentNumber;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import Base from "../../../../Base";
|
|
2
|
-
import { Database } from "../../../../interfaces/friday";
|
|
1
|
+
import Base, { MaybeRaw } from "../../../../Base";
|
|
3
2
|
import { PaginatedResponse, SearchParams } from "../../../../interfaces/global";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { Database } from "../../../../interfaces/high5";
|
|
4
|
+
import { High5Document } from "./document";
|
|
5
|
+
export declare class High5Database extends Base {
|
|
6
|
+
get document(): High5Document;
|
|
7
7
|
private _document?;
|
|
8
8
|
/**
|
|
9
|
-
* Retrieves all Databases of a
|
|
9
|
+
* Retrieves all Databases of a High5 Space which match the provided search filter(s). Will return all Databases of the Space if no filter is provided.
|
|
10
10
|
* @param orgName Name of the Organization
|
|
11
11
|
* @param spaceName Name of the Space
|
|
12
12
|
* @param filters (optional) Array of search filters
|
|
@@ -15,10 +15,12 @@ export declare class FridayDatabase extends Base {
|
|
|
15
15
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
16
16
|
* @returns Object containing an array of Databases and the total number of results found in the database (independent of limit and page)
|
|
17
17
|
*/
|
|
18
|
-
searchDatabases({ orgName, spaceName, filters, sorting, limit, page
|
|
18
|
+
searchDatabases<R extends boolean = false>({ orgName, spaceName, filters, sorting, limit, page }: SearchParams & {
|
|
19
19
|
orgName: string;
|
|
20
20
|
spaceName: string;
|
|
21
|
-
}
|
|
21
|
+
}, raw?: {
|
|
22
|
+
raw: R;
|
|
23
|
+
}): Promise<MaybeRaw<R, PaginatedResponse<Database>>>;
|
|
22
24
|
/**
|
|
23
25
|
* Retrieves a Database by its name.
|
|
24
26
|
* @param orgName Name of the Organization
|
|
@@ -26,7 +28,9 @@ export declare class FridayDatabase extends Base {
|
|
|
26
28
|
* @param dbName Name of the Database
|
|
27
29
|
* @returns The requested Database
|
|
28
30
|
*/
|
|
29
|
-
getDatabase(orgName: string, spaceName: string, dbName: string
|
|
31
|
+
getDatabase<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, raw?: {
|
|
32
|
+
raw: R;
|
|
33
|
+
}): Promise<MaybeRaw<R, Database>>;
|
|
30
34
|
/**
|
|
31
35
|
* Creates a new Database in the provided Space.
|
|
32
36
|
* @param orgName Name of the Organization
|
|
@@ -34,7 +38,9 @@ export declare class FridayDatabase extends Base {
|
|
|
34
38
|
* @param name Name of the new Database
|
|
35
39
|
* @returns The created Database
|
|
36
40
|
*/
|
|
37
|
-
createDatabase(orgName: string, spaceName: string, name: string
|
|
41
|
+
createDatabase<R extends boolean = false>(orgName: string, spaceName: string, name: string, raw?: {
|
|
42
|
+
raw: R;
|
|
43
|
+
}): Promise<MaybeRaw<R, Database>>;
|
|
38
44
|
/**
|
|
39
45
|
* Rename a Database
|
|
40
46
|
* @param orgName Name of the Organization
|
|
@@ -43,13 +49,17 @@ export declare class FridayDatabase extends Base {
|
|
|
43
49
|
* @param name New name of the Database
|
|
44
50
|
* @returns Updated Database
|
|
45
51
|
*/
|
|
46
|
-
renameDatabase(orgName: string, spaceName: string, dbName: string, name: string
|
|
52
|
+
renameDatabase<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, name: string, raw?: {
|
|
53
|
+
raw: R;
|
|
54
|
+
}): Promise<MaybeRaw<R, Database>>;
|
|
47
55
|
/**
|
|
48
56
|
* Deletes a Database by its name.
|
|
49
57
|
* @param orgName Name of the Organization
|
|
50
58
|
* @param spaceName Name of the Space
|
|
51
59
|
* @param dbName Name of the Database
|
|
52
60
|
*/
|
|
53
|
-
deleteDatabase(orgName: string, spaceName: string, dbName: string
|
|
61
|
+
deleteDatabase<R extends boolean = false>(orgName: string, spaceName: string, dbName: string, raw?: {
|
|
62
|
+
raw: R;
|
|
63
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
54
64
|
protected getEndpoint(endpoint: string): string;
|
|
55
65
|
}
|