@maxim_mazurok/gapi.client.pubsublite-v1 0.0.20231103 → 0.0.20231124

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 CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.pubsublite-v1",
3
- "version": "0.0.20231103",
3
+ "version": "0.0.20231124",
4
4
  "description": "TypeScript typings for Pub/Sub Lite API v1",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
8
+ },
5
9
  "license": "MIT",
6
10
  "author": {
7
- "email": "maxim@mazurok.com",
8
11
  "name": "Maxim Mazurok",
12
+ "email": "maxim@mazurok.com",
9
13
  "url": "https://maxim.mazurok.com"
10
14
  },
11
- "repository": {
12
- "type": "git",
13
- "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
14
- },
15
15
  "types": "index.d.ts",
16
16
  "dependencies": {
17
17
  "@types/gapi.client": "*",
package/readme.md CHANGED
@@ -1,6 +1,5 @@
1
1
  # TypeScript typings for Pub/Sub Lite API v1
2
2
 
3
-
4
3
  For detailed description please check [documentation](https://cloud.google.com/pubsub/lite/docs).
5
4
 
6
5
  ## Installing
@@ -25,10 +24,13 @@ gapi.load('client', () => {
25
24
  Then load api client wrapper:
26
25
 
27
26
  ```typescript
28
- gapi.client.load('https://pubsublite.googleapis.com/$discovery/rest?version=v1', () => {
29
- // now we can use:
30
- // gapi.client.pubsublite
31
- });
27
+ gapi.client.load(
28
+ 'https://pubsublite.googleapis.com/$discovery/rest?version=v1',
29
+ () => {
30
+ // now we can use:
31
+ // gapi.client.pubsublite
32
+ }
33
+ );
32
34
  ```
33
35
 
34
36
  ```typescript
@@ -45,24 +47,26 @@ Don't forget to authenticate your client before sending any request to resources
45
47
  // declare client_id registered in Google Developers Console
46
48
  var client_id = '',
47
49
  scope = [
48
- // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
49
- 'https://www.googleapis.com/auth/cloud-platform',
50
- ],
51
- immediate = true;
50
+ // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
51
+ 'https://www.googleapis.com/auth/cloud-platform',
52
+ ],
53
+ immediate = true;
52
54
  // ...
53
55
 
54
56
  gapi.auth.authorize(
55
- { client_id: client_id, scope: scope, immediate: immediate },
57
+ {client_id: client_id, scope: scope, immediate: immediate},
56
58
  authResult => {
57
59
  if (authResult && !authResult.error) {
58
- /* handle successful authorization */
60
+ /* handle successful authorization */
59
61
  } else {
60
- /* handle authorization error */
62
+ /* handle authorization error */
61
63
  }
62
- });
64
+ }
65
+ );
63
66
  ```
64
67
 
65
68
  After that you can use Pub/Sub Lite API resources: <!-- TODO: make this work for multiple namespaces -->
66
69
 
67
70
  ```typescript
71
+
68
72
  ```
package/tests.ts DELETED
@@ -1,282 +0,0 @@
1
- /* This is stub file for gapi.client.pubsublite-v1 definition tests */
2
- // IMPORTANT
3
- // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
- // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
-
6
- // Revision: 20231103
7
-
8
- gapi.load('client', async () => {
9
- /** now we can use gapi.client */
10
-
11
- await gapi.client.load('https://pubsublite.googleapis.com/$discovery/rest?version=v1');
12
- /** now we can use gapi.client.pubsublite */
13
-
14
- /** don't forget to authenticate your client before sending any request to resources: */
15
- /** declare client_id registered in Google Developers Console */
16
- const client_id = '<<PUT YOUR CLIENT ID HERE>>';
17
- const scope = [
18
- /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
19
- 'https://www.googleapis.com/auth/cloud-platform',
20
- ];
21
- const immediate = false;
22
- gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
23
- if (authResult && !authResult.error) {
24
- /** handle successful authorization */
25
- run();
26
- } else {
27
- /** handle authorization error */
28
- }
29
- });
30
-
31
- async function run() {
32
- /**
33
- * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this
34
- * method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation
35
- * completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of
36
- * 1, corresponding to `Code.CANCELLED`.
37
- */
38
- await gapi.client.pubsublite.admin.projects.locations.operations.cancel({
39
- name: "Test string",
40
- }, {
41
- });
42
- /**
43
- * Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support
44
- * this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
45
- */
46
- await gapi.client.pubsublite.admin.projects.locations.operations.delete({
47
- name: "Test string",
48
- });
49
- /** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */
50
- await gapi.client.pubsublite.admin.projects.locations.operations.get({
51
- name: "Test string",
52
- });
53
- /** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
54
- await gapi.client.pubsublite.admin.projects.locations.operations.list({
55
- filter: "Test string",
56
- name: "Test string",
57
- pageSize: 42,
58
- pageToken: "Test string",
59
- });
60
- /** Creates a new reservation. */
61
- await gapi.client.pubsublite.admin.projects.locations.reservations.create({
62
- parent: "Test string",
63
- reservationId: "Test string",
64
- }, {
65
- name: "Test string",
66
- throughputCapacity: "Test string",
67
- });
68
- /** Deletes the specified reservation. */
69
- await gapi.client.pubsublite.admin.projects.locations.reservations.delete({
70
- name: "Test string",
71
- });
72
- /** Returns the reservation configuration. */
73
- await gapi.client.pubsublite.admin.projects.locations.reservations.get({
74
- name: "Test string",
75
- });
76
- /** Returns the list of reservations for the given project. */
77
- await gapi.client.pubsublite.admin.projects.locations.reservations.list({
78
- pageSize: 42,
79
- pageToken: "Test string",
80
- parent: "Test string",
81
- });
82
- /** Updates properties of the specified reservation. */
83
- await gapi.client.pubsublite.admin.projects.locations.reservations.patch({
84
- name: "Test string",
85
- updateMask: "Test string",
86
- }, {
87
- name: "Test string",
88
- throughputCapacity: "Test string",
89
- });
90
- /** Lists the topics attached to the specified reservation. */
91
- await gapi.client.pubsublite.admin.projects.locations.reservations.topics.list({
92
- name: "Test string",
93
- pageSize: 42,
94
- pageToken: "Test string",
95
- });
96
- /** Creates a new subscription. */
97
- await gapi.client.pubsublite.admin.projects.locations.subscriptions.create({
98
- parent: "Test string",
99
- skipBacklog: true,
100
- subscriptionId: "Test string",
101
- }, {
102
- deliveryConfig: {
103
- deliveryRequirement: "Test string",
104
- },
105
- exportConfig: {
106
- currentState: "Test string",
107
- deadLetterTopic: "Test string",
108
- desiredState: "Test string",
109
- pubsubConfig: {
110
- topic: "Test string",
111
- },
112
- },
113
- name: "Test string",
114
- topic: "Test string",
115
- });
116
- /** Deletes the specified subscription. */
117
- await gapi.client.pubsublite.admin.projects.locations.subscriptions.delete({
118
- name: "Test string",
119
- });
120
- /** Returns the subscription configuration. */
121
- await gapi.client.pubsublite.admin.projects.locations.subscriptions.get({
122
- name: "Test string",
123
- });
124
- /** Returns the list of subscriptions for the given project. */
125
- await gapi.client.pubsublite.admin.projects.locations.subscriptions.list({
126
- pageSize: 42,
127
- pageToken: "Test string",
128
- parent: "Test string",
129
- });
130
- /** Updates properties of the specified subscription. */
131
- await gapi.client.pubsublite.admin.projects.locations.subscriptions.patch({
132
- name: "Test string",
133
- updateMask: "Test string",
134
- }, {
135
- deliveryConfig: {
136
- deliveryRequirement: "Test string",
137
- },
138
- exportConfig: {
139
- currentState: "Test string",
140
- deadLetterTopic: "Test string",
141
- desiredState: "Test string",
142
- pubsubConfig: {
143
- topic: "Test string",
144
- },
145
- },
146
- name: "Test string",
147
- topic: "Test string",
148
- });
149
- /**
150
- * Performs an out-of-band seek for a subscription to a specified target, which may be timestamps or named positions within the message backlog. Seek translates these targets to cursors
151
- * for each partition and orchestrates subscribers to start consuming messages from these seek cursors. If an operation is returned, the seek has been registered and subscribers will
152
- * eventually receive messages from the seek cursors (i.e. eventual consistency), as long as they are using a minimum supported client library version and not a system that tracks cursors
153
- * independently of Pub/Sub Lite (e.g. Apache Beam, Dataflow, Spark). The seek operation will fail for unsupported clients. If clients would like to know when subscribers react to the seek
154
- * (or not), they can poll the operation. The seek operation will succeed and complete once subscribers are ready to receive messages from the seek cursors for all partitions of the topic.
155
- * This means that the seek operation will not complete until all subscribers come online. If the previous seek operation has not yet completed, it will be aborted and the new invocation
156
- * of seek will supersede it.
157
- */
158
- await gapi.client.pubsublite.admin.projects.locations.subscriptions.seek({
159
- name: "Test string",
160
- }, {
161
- namedTarget: "Test string",
162
- timeTarget: {
163
- eventTime: "Test string",
164
- publishTime: "Test string",
165
- },
166
- });
167
- /** Creates a new topic. */
168
- await gapi.client.pubsublite.admin.projects.locations.topics.create({
169
- parent: "Test string",
170
- topicId: "Test string",
171
- }, {
172
- name: "Test string",
173
- partitionConfig: {
174
- capacity: {
175
- publishMibPerSec: 42,
176
- subscribeMibPerSec: 42,
177
- },
178
- count: "Test string",
179
- scale: 42,
180
- },
181
- reservationConfig: {
182
- throughputReservation: "Test string",
183
- },
184
- retentionConfig: {
185
- period: "Test string",
186
- perPartitionBytes: "Test string",
187
- },
188
- });
189
- /** Deletes the specified topic. */
190
- await gapi.client.pubsublite.admin.projects.locations.topics.delete({
191
- name: "Test string",
192
- });
193
- /** Returns the topic configuration. */
194
- await gapi.client.pubsublite.admin.projects.locations.topics.get({
195
- name: "Test string",
196
- });
197
- /** Returns the partition information for the requested topic. */
198
- await gapi.client.pubsublite.admin.projects.locations.topics.getPartitions({
199
- name: "Test string",
200
- });
201
- /** Returns the list of topics for the given project. */
202
- await gapi.client.pubsublite.admin.projects.locations.topics.list({
203
- pageSize: 42,
204
- pageToken: "Test string",
205
- parent: "Test string",
206
- });
207
- /** Updates properties of the specified topic. */
208
- await gapi.client.pubsublite.admin.projects.locations.topics.patch({
209
- name: "Test string",
210
- updateMask: "Test string",
211
- }, {
212
- name: "Test string",
213
- partitionConfig: {
214
- capacity: {
215
- publishMibPerSec: 42,
216
- subscribeMibPerSec: 42,
217
- },
218
- count: "Test string",
219
- scale: 42,
220
- },
221
- reservationConfig: {
222
- throughputReservation: "Test string",
223
- },
224
- retentionConfig: {
225
- period: "Test string",
226
- perPartitionBytes: "Test string",
227
- },
228
- });
229
- /** Lists the subscriptions attached to the specified topic. */
230
- await gapi.client.pubsublite.admin.projects.locations.topics.subscriptions.list({
231
- name: "Test string",
232
- pageSize: 42,
233
- pageToken: "Test string",
234
- });
235
- /** Updates the committed cursor. */
236
- await gapi.client.pubsublite.cursor.projects.locations.subscriptions.commitCursor({
237
- subscription: "Test string",
238
- }, {
239
- cursor: {
240
- offset: "Test string",
241
- },
242
- partition: "Test string",
243
- });
244
- /** Returns all committed cursor information for a subscription. */
245
- await gapi.client.pubsublite.cursor.projects.locations.subscriptions.cursors.list({
246
- pageSize: 42,
247
- pageToken: "Test string",
248
- parent: "Test string",
249
- });
250
- /**
251
- * Compute the head cursor for the partition. The head cursor's offset is guaranteed to be less than or equal to all messages which have not yet been acknowledged as published, and greater
252
- * than the offset of any message whose publish has already been acknowledged. It is zero if there have never been messages in the partition.
253
- */
254
- await gapi.client.pubsublite.topicStats.projects.locations.topics.computeHeadCursor({
255
- topic: "Test string",
256
- }, {
257
- partition: "Test string",
258
- });
259
- /** Compute statistics about a range of messages in a given topic and partition. */
260
- await gapi.client.pubsublite.topicStats.projects.locations.topics.computeMessageStats({
261
- topic: "Test string",
262
- }, {
263
- endCursor: {
264
- offset: "Test string",
265
- },
266
- partition: "Test string",
267
- startCursor: {
268
- offset: "Test string",
269
- },
270
- });
271
- /** Compute the corresponding cursor for a publish or event time in a topic partition. */
272
- await gapi.client.pubsublite.topicStats.projects.locations.topics.computeTimeCursor({
273
- topic: "Test string",
274
- }, {
275
- partition: "Test string",
276
- target: {
277
- eventTime: "Test string",
278
- publishTime: "Test string",
279
- },
280
- });
281
- }
282
- });
package/tsconfig.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "lib": ["es6", "dom"],
5
- "noImplicitAny": true,
6
- "noImplicitThis": true,
7
- "strictNullChecks": true,
8
- "baseUrl": "../",
9
- "typeRoots": [
10
- "../"
11
- ],
12
- "types": [],
13
- "noEmit": true,
14
- "forceConsistentCasingInFileNames": true,
15
- "strictFunctionTypes": true
16
- },
17
- "files": ["index.d.ts", "tests.ts"]
18
- }
package/tslint.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "dtslint/dtslint.json",
3
- "rules": {
4
- "no-redundant-jsdoc": false
5
- }
6
- }