Skip to content

Commit a33c85b

Browse files
author
williamd5
committed
regen
1 parent e601007 commit a33c85b

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/Cloudnode.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ declare class Cloudnode {
2020
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
2121
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
2222
*/
23-
list: (limit?: number, page?: number) => Promise<Cloudnode.PaginatedData<Cloudnode.Newsletter[]>>;
23+
readonly list: (limit?: number, page?: number) => Promise<Cloudnode.PaginatedData<Cloudnode.Newsletter[]>>;
2424
/**
2525
* Get newsletter
2626
* @GET /newsletter/:id
@@ -30,7 +30,7 @@ declare class Cloudnode {
3030
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
3131
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
3232
*/
33-
get: (id: string) => Promise<Cloudnode.Newsletter>;
33+
readonly get: (id: string) => Promise<Cloudnode.Newsletter>;
3434
/**
3535
* Subscribe to newsletter
3636
* @POST /newsletter/:id/subscribe
@@ -44,7 +44,7 @@ declare class Cloudnode {
4444
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
4545
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
4646
*/
47-
subscribe: (id: string, email: string, data?: Record<string, string | number | boolean>) => Promise<Cloudnode.NewsletterSubscription>;
47+
readonly subscribe: (id: string, email: string, data?: Record<string, string | number | boolean>) => Promise<Cloudnode.NewsletterSubscription>;
4848
};
4949
newsletters: {
5050
/**
@@ -57,7 +57,7 @@ declare class Cloudnode {
5757
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
5858
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
5959
*/
60-
unsubscribe: (subscription: string) => Promise<void>;
60+
readonly unsubscribe: (subscription: string) => Promise<void>;
6161
/**
6262
* List subscriptions of the authenticated user
6363
* @GET /newsletters/subscriptions
@@ -69,7 +69,7 @@ declare class Cloudnode {
6969
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
7070
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
7171
*/
72-
listSubscriptions: (limit?: number, page?: number) => Promise<Cloudnode.PaginatedData<Cloudnode.DatedNewsletterSubscription[]>>;
72+
readonly listSubscriptions: (limit?: number, page?: number) => Promise<Cloudnode.PaginatedData<Cloudnode.DatedNewsletterSubscription[]>>;
7373
};
7474
token: {
7575
/**
@@ -84,7 +84,7 @@ declare class Cloudnode {
8484
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
8585
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
8686
*/
87-
list: (limit?: number, page?: number, internal?: any) => Promise<Cloudnode.PaginatedData<Cloudnode.PartialToken[]>>;
87+
readonly list: (limit?: number, page?: number, internal?: any) => Promise<Cloudnode.PaginatedData<Cloudnode.PartialToken[]>>;
8888
/**
8989
* Create token
9090
* @POST /token
@@ -98,7 +98,7 @@ declare class Cloudnode {
9898
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
9999
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
100100
*/
101-
create: (permissions: string[], lifetime: number, note?: string) => Promise<Cloudnode.Token>;
101+
readonly create: (permissions: string[], lifetime: number, note?: string) => Promise<Cloudnode.Token>;
102102
/**
103103
* Get token details
104104
* @GET /token/:id
@@ -111,7 +111,7 @@ declare class Cloudnode {
111111
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
112112
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
113113
*/
114-
get: (id: string) => Promise<Cloudnode.Token>;
114+
readonly get: (id: string) => Promise<Cloudnode.Token>;
115115
/**
116116
* Revoke token
117117
* @DELETE /token/:id
@@ -125,7 +125,7 @@ declare class Cloudnode {
125125
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
126126
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
127127
*/
128-
revoke: (id: string) => Promise<void>;
128+
readonly revoke: (id: string) => Promise<void>;
129129
};
130130
tokens: {
131131
/**
@@ -138,7 +138,7 @@ declare class Cloudnode {
138138
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
139139
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
140140
*/
141-
refresh: () => Promise<Cloudnode.Token>;
141+
readonly refresh: () => Promise<Cloudnode.Token>;
142142
};
143143
}
144144
declare namespace Cloudnode {

src/Cloudnode.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class Cloudnode {
120120
subscribe: async (id: string, email: string, data?: Record<string, string | number | boolean>): Promise<Cloudnode.NewsletterSubscription> => {
121121
return await this.#sendRequest<Cloudnode.NewsletterSubscription>({"type":"operation","description":"Subscribe to newsletter","method":"POST","path":"/newsletter/:id/subscribe","parameters":{"path":{"id":{"description":"A newsletter ID","type":"string","required":true}},"body":{"email":{"description":"Subscriber's email address","type":"string","required":true},"data":{"description":"Additional data that this newsletter requires","type":"Record<string, string | number | boolean>","required":false}}},"returns":[{"status":201,"type":"NewsletterSubscription"},{"status":404,"type":"Error & {code: \"RESOURCE_NOT_FOUND\"}"},{"status":422,"type":"Error & {code: \"INVALID_DATA\"}"},{"status":409,"type":"Error & {code: \"CONFLICT\"}"},{"status":429,"type":"Error & {code: \"RATE_LIMITED\"}"},{"status":500,"type":"Error & {code: \"INTERNAL_SERVER_ERROR\"}"},{"status":503,"type":"Error & {code: \"MAINTENANCE\"}"}]}, {id: `${id}`}, {}, {email, data});
122122
},
123-
}
123+
} as const;
124124
public newsletters = {
125125
/**
126126
* Revoke a subscription (unsubscribe)
@@ -149,7 +149,7 @@ class Cloudnode {
149149
listSubscriptions: async (limit: number = 10, page: number = 1): Promise<Cloudnode.PaginatedData<Cloudnode.DatedNewsletterSubscription[]>> => {
150150
return await this.#sendRequest<Cloudnode.PaginatedData<Cloudnode.DatedNewsletterSubscription[]>>({"type":"operation","description":"List subscriptions of the authenticated user","token":"newsletter.subscriptions.list.own","method":"GET","path":"/newsletters/subscriptions","parameters":{"query":{"limit":{"description":"The number of subscriptions to return per page. No more than 50.","default":"10","type":"number","required":false},"page":{"description":"The page number. No more than 2³² (4294967296).","default":"1","type":"number","required":false}}},"returns":[{"status":200,"type":"DatedNewsletterSubscription[]"},{"status":401,"type":"Error & {code: \"UNAUTHORIZED\"}"},{"status":403,"type":"Error & {code: \"NO_PERMISSION\"}"},{"status":429,"type":"Error & {code: \"RATE_LIMITED\"}"},{"status":500,"type":"Error & {code: \"INTERNAL_SERVER_ERROR\"}"},{"status":503,"type":"Error & {code: \"MAINTENANCE\"}"}]}, {}, {limit: `${limit}`, page: `${page}`}, {});
151151
},
152-
}
152+
} as const;
153153
public token = {
154154
/**
155155
* List tokens of user
@@ -213,7 +213,7 @@ class Cloudnode {
213213
revoke: async (id: string): Promise<void> => {
214214
return await this.#sendRequest<void>({"type":"operation","description":"Revoke token","token":"tokens.revoke.own","method":"DELETE","path":"/token/:id","parameters":{"path":{"id":{"description":"The ID of the token to revoke. Specify `current` to revoke the token that was used to authenticate the request.","type":"string","required":true}}},"returns":[{"status":204,"type":"void"},{"status":404,"type":"Error & {code: \"RESOURCE_NOT_FOUND\"}"},{"status":422,"type":"Error & {code: \"INVALID_DATA\"}"},{"status":400,"type":"Error & {code: \"MODIFICATION_NOT_ALLOWED\"}"},{"status":401,"type":"Error & {code: \"UNAUTHORIZED\"}"},{"status":403,"type":"Error & {code: \"NO_PERMISSION\"}"},{"status":429,"type":"Error & {code: \"RATE_LIMITED\"}"},{"status":500,"type":"Error & {code: \"INTERNAL_SERVER_ERROR\"}"},{"status":503,"type":"Error & {code: \"MAINTENANCE\"}"}]}, {id: `${id}`}, {}, {});
215215
},
216-
}
216+
} as const;
217217
public tokens = {
218218
/**
219219
* Refresh current token. The token that was used to authenticate the request will be deleted. A new token with a new ID but the same permissions will be created and returned. The lifespan of the new token will be the same as the old one, starting from the time of the request. This operation effectively allows a token to be used indefinitely.
@@ -228,7 +228,7 @@ class Cloudnode {
228228
refresh: async (): Promise<Cloudnode.Token> => {
229229
return await this.#sendRequest<Cloudnode.Token>({"type":"operation","description":"Refresh current token. The token that was used to authenticate the request will be deleted. A new token with a new ID but the same permissions will be created and returned. The lifespan of the new token will be the same as the old one, starting from the time of the request. This operation effectively allows a token to be used indefinitely.","token":"token.refresh","method":"POST","path":"/token/refresh","parameters":{},"returns":[{"status":201,"type":"Token"},{"status":422,"type":"Error & {code: \"INVALID_DATA\"}"},{"status":401,"type":"Error & {code: \"UNAUTHORIZED\"}"},{"status":403,"type":"Error & {code: \"NO_PERMISSION\"}"},{"status":429,"type":"Error & {code: \"RATE_LIMITED\"}"},{"status":500,"type":"Error & {code: \"INTERNAL_SERVER_ERROR\"}"},{"status":503,"type":"Error & {code: \"MAINTENANCE\"}"}]}, {}, {}, {});
230230
},
231-
}
231+
} as const;
232232

233233
}
234234

0 commit comments

Comments
 (0)