@maxim_mazurok/gapi.client.calendar-v3 0.0.20220805

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/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.calendar-v3",
3
+ "version": "0.0.20220805",
4
+ "description": "TypeScript typings for Calendar API v3",
5
+ "license": "MIT",
6
+ "author": {
7
+ "email": "maxim@mazurok.com",
8
+ "name": "Maxim Mazurok",
9
+ "url": "https://maxim.mazurok.com"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
14
+ },
15
+ "types": "index.d.ts",
16
+ "dependencies": {
17
+ "@types/gapi.client": "*",
18
+ "@types/gapi.client.discovery": "*"
19
+ }
20
+ }
package/readme.md ADDED
@@ -0,0 +1,265 @@
1
+ # TypeScript typings for Calendar API v3
2
+
3
+ Manipulates events and other calendar data.
4
+ For detailed description please check [documentation](https://developers.google.com/google-apps/calendar/firstapp).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Calendar API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.calendar-v3 --save-dev
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ You need to initialize Google API client in your code:
17
+
18
+ ```typescript
19
+ gapi.load('client', () => {
20
+ // now we can use gapi.client
21
+ // ...
22
+ });
23
+ ```
24
+
25
+ Then load api client wrapper:
26
+
27
+ ```typescript
28
+ gapi.client.load('https://calendar-json.googleapis.com/$discovery/rest?version=v3', () => {
29
+ // now we can use:
30
+ // gapi.client.calendar
31
+ });
32
+ ```
33
+
34
+ ```typescript
35
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
36
+ gapi.client.load('calendar', 'v3', () => {
37
+ // now we can use:
38
+ // gapi.client.calendar
39
+ });
40
+ ```
41
+
42
+ Don't forget to authenticate your client before sending any request to resources:
43
+
44
+ ```typescript
45
+ // declare client_id registered in Google Developers Console
46
+ var client_id = '',
47
+ scope = [
48
+ // See, edit, share, and permanently delete all the calendars you can access using Google Calendar
49
+ 'https://www.googleapis.com/auth/calendar',
50
+
51
+ // View and edit events on all your calendars
52
+ 'https://www.googleapis.com/auth/calendar.events',
53
+
54
+ // View events on all your calendars
55
+ 'https://www.googleapis.com/auth/calendar.events.readonly',
56
+
57
+ // See and download any calendar you can access using your Google Calendar
58
+ 'https://www.googleapis.com/auth/calendar.readonly',
59
+
60
+ // View your Calendar settings
61
+ 'https://www.googleapis.com/auth/calendar.settings.readonly',
62
+ ],
63
+ immediate = true;
64
+ // ...
65
+
66
+ gapi.auth.authorize(
67
+ { client_id: client_id, scope: scope, immediate: immediate },
68
+ authResult => {
69
+ if (authResult && !authResult.error) {
70
+ /* handle successful authorization */
71
+ } else {
72
+ /* handle authorization error */
73
+ }
74
+ });
75
+ ```
76
+
77
+ After that you can use Calendar API resources: <!-- TODO: make this work for multiple namespaces -->
78
+
79
+ ```typescript
80
+
81
+ /*
82
+ Deletes an access control rule.
83
+ */
84
+ await gapi.client.calendar.acl.delete({ calendarId: "calendarId", ruleId: "ruleId", });
85
+
86
+ /*
87
+ Returns an access control rule.
88
+ */
89
+ await gapi.client.calendar.acl.get({ calendarId: "calendarId", ruleId: "ruleId", });
90
+
91
+ /*
92
+ Creates an access control rule.
93
+ */
94
+ await gapi.client.calendar.acl.insert({ calendarId: "calendarId", });
95
+
96
+ /*
97
+ Returns the rules in the access control list for the calendar.
98
+ */
99
+ await gapi.client.calendar.acl.list({ calendarId: "calendarId", });
100
+
101
+ /*
102
+ Updates an access control rule. This method supports patch semantics.
103
+ */
104
+ await gapi.client.calendar.acl.patch({ calendarId: "calendarId", ruleId: "ruleId", });
105
+
106
+ /*
107
+ Updates an access control rule.
108
+ */
109
+ await gapi.client.calendar.acl.update({ calendarId: "calendarId", ruleId: "ruleId", });
110
+
111
+ /*
112
+ Watch for changes to ACL resources.
113
+ */
114
+ await gapi.client.calendar.acl.watch({ calendarId: "calendarId", });
115
+
116
+ /*
117
+ Removes a calendar from the user's calendar list.
118
+ */
119
+ await gapi.client.calendar.calendarList.delete({ calendarId: "calendarId", });
120
+
121
+ /*
122
+ Returns a calendar from the user's calendar list.
123
+ */
124
+ await gapi.client.calendar.calendarList.get({ calendarId: "calendarId", });
125
+
126
+ /*
127
+ Inserts an existing calendar into the user's calendar list.
128
+ */
129
+ await gapi.client.calendar.calendarList.insert({ });
130
+
131
+ /*
132
+ Returns the calendars on the user's calendar list.
133
+ */
134
+ await gapi.client.calendar.calendarList.list({ });
135
+
136
+ /*
137
+ Updates an existing calendar on the user's calendar list. This method supports patch semantics.
138
+ */
139
+ await gapi.client.calendar.calendarList.patch({ calendarId: "calendarId", });
140
+
141
+ /*
142
+ Updates an existing calendar on the user's calendar list.
143
+ */
144
+ await gapi.client.calendar.calendarList.update({ calendarId: "calendarId", });
145
+
146
+ /*
147
+ Watch for changes to CalendarList resources.
148
+ */
149
+ await gapi.client.calendar.calendarList.watch({ });
150
+
151
+ /*
152
+ Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account.
153
+ */
154
+ await gapi.client.calendar.calendars.clear({ calendarId: "calendarId", });
155
+
156
+ /*
157
+ Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars.
158
+ */
159
+ await gapi.client.calendar.calendars.delete({ calendarId: "calendarId", });
160
+
161
+ /*
162
+ Returns metadata for a calendar.
163
+ */
164
+ await gapi.client.calendar.calendars.get({ calendarId: "calendarId", });
165
+
166
+ /*
167
+ Creates a secondary calendar.
168
+ */
169
+ await gapi.client.calendar.calendars.insert({ });
170
+
171
+ /*
172
+ Updates metadata for a calendar. This method supports patch semantics.
173
+ */
174
+ await gapi.client.calendar.calendars.patch({ calendarId: "calendarId", });
175
+
176
+ /*
177
+ Updates metadata for a calendar.
178
+ */
179
+ await gapi.client.calendar.calendars.update({ calendarId: "calendarId", });
180
+
181
+ /*
182
+ Stop watching resources through this channel
183
+ */
184
+ await gapi.client.calendar.channels.stop({ });
185
+
186
+ /*
187
+ Returns the color definitions for calendars and events.
188
+ */
189
+ await gapi.client.calendar.colors.get({ });
190
+
191
+ /*
192
+ Deletes an event.
193
+ */
194
+ await gapi.client.calendar.events.delete({ calendarId: "calendarId", eventId: "eventId", });
195
+
196
+ /*
197
+ Returns an event based on its Google Calendar ID. To retrieve an event using its iCalendar ID, call the events.list method using the iCalUID parameter.
198
+ */
199
+ await gapi.client.calendar.events.get({ calendarId: "calendarId", eventId: "eventId", });
200
+
201
+ /*
202
+ Imports an event. This operation is used to add a private copy of an existing event to a calendar.
203
+ */
204
+ await gapi.client.calendar.events.import({ calendarId: "calendarId", });
205
+
206
+ /*
207
+ Creates an event.
208
+ */
209
+ await gapi.client.calendar.events.insert({ calendarId: "calendarId", });
210
+
211
+ /*
212
+ Returns instances of the specified recurring event.
213
+ */
214
+ await gapi.client.calendar.events.instances({ calendarId: "calendarId", eventId: "eventId", });
215
+
216
+ /*
217
+ Returns events on the specified calendar.
218
+ */
219
+ await gapi.client.calendar.events.list({ calendarId: "calendarId", });
220
+
221
+ /*
222
+ Moves an event to another calendar, i.e. changes an event's organizer.
223
+ */
224
+ await gapi.client.calendar.events.move({ calendarId: "calendarId", destination: "destination", eventId: "eventId", });
225
+
226
+ /*
227
+ Updates an event. This method supports patch semantics.
228
+ */
229
+ await gapi.client.calendar.events.patch({ calendarId: "calendarId", eventId: "eventId", });
230
+
231
+ /*
232
+ Creates an event based on a simple text string.
233
+ */
234
+ await gapi.client.calendar.events.quickAdd({ calendarId: "calendarId", text: "text", });
235
+
236
+ /*
237
+ Updates an event.
238
+ */
239
+ await gapi.client.calendar.events.update({ calendarId: "calendarId", eventId: "eventId", });
240
+
241
+ /*
242
+ Watch for changes to Events resources.
243
+ */
244
+ await gapi.client.calendar.events.watch({ calendarId: "calendarId", });
245
+
246
+ /*
247
+ Returns free/busy information for a set of calendars.
248
+ */
249
+ await gapi.client.calendar.freebusy.query({ });
250
+
251
+ /*
252
+ Returns a single user setting.
253
+ */
254
+ await gapi.client.calendar.settings.get({ setting: "setting", });
255
+
256
+ /*
257
+ Returns all user settings for the authenticated user.
258
+ */
259
+ await gapi.client.calendar.settings.list({ });
260
+
261
+ /*
262
+ Watch for changes to Settings resources.
263
+ */
264
+ await gapi.client.calendar.settings.watch({ });
265
+ ```