@snap/push2web 0.15.1 → 0.16.2

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.
Files changed (40) hide show
  1. package/README.md +11 -7
  2. package/dist/Push2Web.d.ts +8 -9
  3. package/dist/Push2Web.js +9 -8
  4. package/dist/Push2WebSDKExtension.d.ts +5 -6
  5. package/dist/Push2WebSDKExtension.js +33 -18
  6. package/dist/generated-api-client/camera_kit/v3/export.d.ts +19 -19
  7. package/dist/generated-api-client/camera_kit/v3/export.js +18 -21
  8. package/dist/generated-api-client/camera_kit/v3/push_to_device.d.ts +12 -12
  9. package/dist/generated-api-client/camera_kit/v3/push_to_device.js +14 -17
  10. package/dist/generated-api-client/google/protobuf/descriptor.d.ts +4830 -4830
  11. package/dist/generated-api-client/google/protobuf/descriptor.js +14 -17
  12. package/docs/html/assets/main.js +4 -3
  13. package/docs/html/assets/navigation.js +1 -0
  14. package/docs/html/assets/search.js +1 -1
  15. package/docs/html/assets/style.css +72 -25
  16. package/docs/html/classes/Push2Web.html +15 -147
  17. package/docs/html/enums/Code.html +28 -198
  18. package/docs/html/enums/ListenLensPushResponse_ExcludedLens_Code.html +8 -98
  19. package/docs/html/enums/State.html +5 -79
  20. package/docs/html/index.html +6 -69
  21. package/docs/html/interfaces/Lens.html +12 -143
  22. package/docs/html/modules.html +12 -66
  23. package/docs/html/types/CommunicationErrorEvent.html +6 -76
  24. package/docs/html/types/ErrorEvent.html +1 -50
  25. package/docs/html/types/GenericErrorEvent.html +4 -66
  26. package/docs/html/types/LensExcludedErrorEvent.html +7 -78
  27. package/docs/html/types/LensReceivedEvent.html +1 -50
  28. package/docs/html/types/Push2WebEvents.html +1 -50
  29. package/docs/html/types/SubscriptionChangedEvent.html +1 -50
  30. package/docs/html/types/SubscriptionInstance.html +5 -79
  31. package/docs/md/README.md +12 -7
  32. package/docs/md/classes/Push2Web.md +16 -12
  33. package/docs/md/enums/Code.md +1 -1
  34. package/docs/md/enums/ListenLensPushResponse_ExcludedLens_Code.md +1 -1
  35. package/docs/md/enums/State.md +1 -1
  36. package/docs/md/interfaces/Lens.md +2 -2
  37. package/docs/md/modules.md +6 -6
  38. package/package.json +8 -5
  39. package/dist/reportEvent.d.ts +0 -3
  40. package/dist/reportEvent.js +0 -30
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Snap Camera Kit Web SDK - Push to Web Extension
2
2
 
3
- This extension for [Camera Kit Web SDK](https://www.npmjs.com/package/@snap/camera-kit) package, allows users to send lenses created in [Lens Studio](https://ar.snap.com/lens-studio) to their web pages. Simply create a lens in Lens Studio and then click the "Send to Camera Kit" button.
3
+ This extension for the [Camera Kit Web SDK](https://www.npmjs.com/package/@snap/camera-kit) package. It allows users to send Lenses created in [Lens Studio](https://ar.snap.com/lens-studio) to their web pages. Simply create a Lens in Lens Studio and then click the "Send to Camera Kit" button.
4
4
 
5
5
  ## Prerequisites
6
6
 
@@ -9,6 +9,7 @@ Web pages should be integrated with Snap Login Kit in advance. This will allow u
9
9
  For quick integration, the Client-Side Only Web Application Integration method can be used. This method does not require any changes to the server-side code of your web page. Instead, it uses JavaScript to interact with the Snap Login Kit API.
10
10
 
11
11
  ### !!! Important !!!
12
+
12
13
  ```
13
14
  !!! ONLY STAGING LOGIN KIT CLIENT ID IS SUPPORTED !!!
14
15
  ```
@@ -17,9 +18,7 @@ For quick integration, the Client-Side Only Web Application Integration method c
17
18
 
18
19
  [Client-Side Only Web Application Integration](https://docs.snap.com/snap-kit/login-kit/Tutorials/web#client-side-only-web-application-integration)
19
20
 
20
- ###
21
-
22
- ## Getting started
21
+ ## Getting Started
23
22
 
24
23
  ```
25
24
  npm install @snap/push2web
@@ -28,6 +27,7 @@ npm install @snap/push2web
28
27
  ## Usage
29
28
 
30
29
  Import the extension object from the package and create a new instance.
30
+
31
31
  ```ts
32
32
  import { Push2Web } from "@snap/push2web";
33
33
 
@@ -35,13 +35,15 @@ const push2Web = new Push2Web();
35
35
  ```
36
36
 
37
37
  The following events are available for subscription, if needed.
38
+
38
39
  ```ts
39
40
  push2Web.events.addEventListener("lensReceived", (event) => { const lensDetails = event.detail; });
40
41
  push2Web.events.addEventListener("error", (event) => { const errorDetails = event.detail; });
41
42
  push2Web.events.addEventListener("subscriptionChanged", (event) => { const subState = event.detail; };)
42
43
  ```
43
44
 
44
- Provide the push2web extension object during the Camera Kit bootstrap. It is essential to be familiar with the `@snap/camera-kit` package before using the `@snap/push2web` extension. Please find more details on [Camera Kit Web SDK documentation](https://docs.snap.com/camera-kit/quick-start/integrate-sdk/integrate-sdk-web/web-configuration) page.
45
+ Provide the push2web extension object during the Camera Kit bootstrap. It is essential to be familiar with the `@snap/camera-kit` package before using the `@snap/push2web` extension. Please find more details on the [Camera Kit Web SDK documentation](https://docs.snap.com/camera-kit/quick-start/integrate-sdk/integrate-sdk-web/web-configuration) page.
46
+
45
47
  ```ts
46
48
  import { bootstrapCameraKit } from "@snap/camera-kit";
47
49
 
@@ -51,17 +53,19 @@ const cameraKit = await bootstrapCameraKit({ apiToken: "token from developer por
51
53
  const cameraKitSession = await cameraKit.createSession();
52
54
  ```
53
55
 
56
+ Before pushing any Lenses from Lens Studio, a subscription to a network stream must be established. The subscription should be created with the access token received after the user logs in to the web page using Login Kit integration.
54
57
 
55
- Before pushing any lenses from Lens Studio, a subscription to a network stream must be established. Subscription should be created with the access token received after the user logs in to the web page using Login Kit integration.
56
58
  ```ts
57
59
  const loginKitAccessToken = "this token will be provided by Login Kit after user login";
58
60
  const subscription = push2Web.subscribe(loginKitAccessToken, cameraKitSession, cameraKit.lensRepository);
59
61
  ```
60
62
 
61
- To unsubscribe from a stream, just call unsubscribe method on a subscription object.
63
+ To unsubscribe from a stream, just call the unsubscribe method on a subscription object.
64
+
62
65
  ```ts
63
66
  subscription.unsubscribe();
64
67
  ```
68
+
65
69
  ## Documentation
66
70
 
67
71
  See https://docs.snap.com/camera-kit/quick-start/integrate-sdk/integrate-sdk-web/guides/push-2-web
@@ -7,7 +7,7 @@ export declare class Push2Web {
7
7
  *
8
8
  * Subscribe to `error` event to be aware if something has happened during the lens push,
9
9
  * with network communication or any other type of error,
10
- * event object also contains detailed expalantion of the cause.
10
+ * event object also contains detailed explanation of the cause.
11
11
  *
12
12
  * Use `subscriptionChanged` event to be aware when subscription state is changed.
13
13
  *
@@ -26,7 +26,7 @@ export declare class Push2Web {
26
26
  readonly events: TypedEventTarget<Push2WebEvents>;
27
27
  private readonly push2WebExtension;
28
28
  private readonly pushedLenses;
29
- private accesToken;
29
+ private accessToken;
30
30
  private subscription?;
31
31
  /**
32
32
  * Create new instance of Push2Web object,
@@ -52,15 +52,14 @@ export declare class Push2Web {
52
52
  */
53
53
  get extension(): import("@snap/camera-kit").PartialContainer<{
54
54
  lensSources: import("@snap/camera-kit").LensSource[];
55
- }, {
56
- configuration: import("@snap/camera-kit").CameraKitConfiguration;
57
- }>;
55
+ externalMetricsSubject: import("rxjs").Subject<import("@snap/camera-kit").Count>;
56
+ }, {}>;
58
57
  /**
59
58
  * Initiate subscription for the events from Lens Studio.
60
59
  *
61
60
  * @param accessToken - After user will be logged in to the web page,
62
61
  * using Snapchat account, you can get access token from Login Kit.
63
- * @param cameraKitSession - Instance of CameraKitSesion object form @snap/camera-kit package.
62
+ * @param cameraKitSession - Instance of CameraKitSession object form @snap/camera-kit package.
64
63
  * @param repository - Instance of LensRepository object from @snap/camera-kit package.
65
64
  * @returns @SubscriptionInstance
66
65
  */
@@ -76,7 +75,7 @@ export declare enum State {
76
75
  */
77
76
  Unsubscribed = "Unsubscribed"
78
77
  }
79
- export declare const version = "0.15.1";
78
+ export declare const version = "0.16.2";
80
79
  /**
81
80
  * Generic error event
82
81
  */
@@ -126,7 +125,7 @@ export type LensExcludedErrorEvent = {
126
125
  /**
127
126
  * Lens id
128
127
  */
129
- lensId: number;
128
+ lensId: string;
130
129
  /**
131
130
  * Contains the reason why the lens was excluded.
132
131
  * @deprecated Use `cause.message` instead.
@@ -144,7 +143,7 @@ export type SubscriptionInstance = {
144
143
  /**
145
144
  * This method can be used to provide a new access token for an active connection
146
145
  * in case the previous one has expired.
147
- * @param accessToke Login Kit access token
146
+ * @param accessToken Login Kit access token
148
147
  */
149
148
  updateAccessToken(accessToken: string): void;
150
149
  };
package/dist/Push2Web.js CHANGED
@@ -1,4 +1,5 @@
1
- import { toPublicLens, TypedCustomEvent, TypedEventTarget, getCameraKitUserAgent, } from "@snap/camera-kit";
1
+ import { toPublicLens, TypedCustomEvent, TypedEventTarget } from "@snap/camera-kit";
2
+ import { getCameraKitUserAgent } from "@snap/camera-kit/utils";
2
3
  import { grpc } from "@improbable-eng/grpc-web";
3
4
  import { map, catchError, of, switchMap, ReplaySubject } from "rxjs";
4
5
  import { GrpcWebImpl, ListenLensPushRequest, listenLensPushResponse_ExcludedLens_CodeFromJSON, PushToDeviceClientImpl, } from "./generated-api-client/camera_kit/v3/push_to_device";
@@ -11,7 +12,7 @@ export class Push2Web {
11
12
  *
12
13
  * Subscribe to `error` event to be aware if something has happened during the lens push,
13
14
  * with network communication or any other type of error,
14
- * event object also contains detailed expalantion of the cause.
15
+ * event object also contains detailed explanation of the cause.
15
16
  *
16
17
  * Use `subscriptionChanged` event to be aware when subscription state is changed.
17
18
  *
@@ -30,7 +31,7 @@ export class Push2Web {
30
31
  events = new TypedEventTarget();
31
32
  push2WebExtension = new Push2WebSDKExtension();
32
33
  pushedLenses;
33
- accesToken = new ReplaySubject(1);
34
+ accessToken = new ReplaySubject(1);
34
35
  subscription;
35
36
  /**
36
37
  * Create new instance of Push2Web object,
@@ -39,7 +40,7 @@ export class Push2Web {
39
40
  * Also provides the extension object for the @snap/camera-kit package.
40
41
  */
41
42
  constructor() {
42
- this.pushedLenses = this.accesToken.pipe(switchMap((accessToken) => {
43
+ this.pushedLenses = this.accessToken.pipe(switchMap((accessToken) => {
43
44
  const metadata = new grpc.Metadata();
44
45
  metadata.append("Authorization", `Bearer ${accessToken}`);
45
46
  metadata.append("x-snap-client-user-agent", getCameraKitUserAgent());
@@ -100,13 +101,13 @@ export class Push2Web {
100
101
  *
101
102
  * @param accessToken - After user will be logged in to the web page,
102
103
  * using Snapchat account, you can get access token from Login Kit.
103
- * @param cameraKitSession - Instance of CameraKitSesion object form @snap/camera-kit package.
104
+ * @param cameraKitSession - Instance of CameraKitSession object form @snap/camera-kit package.
104
105
  * @param repository - Instance of LensRepository object from @snap/camera-kit package.
105
106
  * @returns @SubscriptionInstance
106
107
  */
107
108
  subscribe(accessToken, cameraKitSession, repository) {
108
109
  this.subscription?.unsubscribe();
109
- this.accesToken.next(accessToken);
110
+ this.accessToken.next(accessToken);
110
111
  this.subscription = this.pushedLenses.subscribe({
111
112
  next: async (event) => {
112
113
  this.events.dispatchEvent(event);
@@ -136,7 +137,7 @@ export class Push2Web {
136
137
  }
137
138
  },
138
139
  updateAccessToken: (accessToken) => {
139
- this.accesToken.next(accessToken);
140
+ this.accessToken.next(accessToken);
140
141
  },
141
142
  };
142
143
  }
@@ -152,4 +153,4 @@ export var State;
152
153
  */
153
154
  State["Unsubscribed"] = "Unsubscribed";
154
155
  })(State || (State = {}));
155
- export const version = "0.15.1";
156
+ export const version = "0.16.2";
@@ -1,15 +1,14 @@
1
- import { CameraKitConfiguration, LensSource } from "@snap/camera-kit";
1
+ import { Subject } from "rxjs";
2
+ import { Count, LensSource, PartialContainer } from "@snap/camera-kit";
2
3
  import type { Push2WebEvents } from "./Push2Web";
3
4
  export declare class Push2WebSDKExtension {
4
- readonly extension: import("@snap/camera-kit").PartialContainer<{
5
+ readonly extension: PartialContainer<{
5
6
  lensSources: LensSource[];
6
- }, {
7
- configuration: CameraKitConfiguration;
7
+ externalMetricsSubject: Subject<Count>;
8
8
  }>;
9
9
  groupId: string;
10
10
  private lastPushedEnvelope;
11
- private metricsReporter;
12
- private metricRequestRateLimitMs;
11
+ private metricsSubject;
13
12
  constructor();
14
13
  updateEnvelope(newEnvelope: ArrayBuffer): void;
15
14
  reportEvent(events: Push2WebEvents): void;
@@ -1,16 +1,13 @@
1
- import { ConcatInjectable, configurationToken, createExtension, lensSourcesFactory, } from "@snap/camera-kit";
2
- import { operationalMetricReporterFactory, } from "@snap/camera-kit/lib/metrics/operational/operationalMetricsReporter";
3
- import { cameraKitServiceFetchHandlerFactory } from "@snap/camera-kit/lib/handlers/cameraKitServiceFetchHandlerFactory";
4
- import { HandlerChainBuilder } from "@snap/camera-kit/lib/handlers/HandlerChainBuilder";
5
- import { createRateLimitingHandler } from "@snap/camera-kit/lib/handlers/rateLimitingHandler";
6
- import { PageVisibility } from "@snap/camera-kit/lib/common/pageVisibility";
7
- import { reportEvent } from "./reportEvent";
1
+ import { Subject } from "rxjs";
2
+ import { ConcatInjectable, Count, externalMetricsSubjectFactory, Injectable, createExtension, lensSourcesFactory, } from "@snap/camera-kit";
3
+ function assertUnreachable(_) {
4
+ throw new Error("Reached unreachable code at runtime.");
5
+ }
8
6
  export class Push2WebSDKExtension {
9
7
  extension;
10
8
  groupId = "PUSH_2_WEB_GROUP_ID";
11
9
  lastPushedEnvelope = undefined;
12
- metricsReporter = undefined;
13
- metricRequestRateLimitMs = 1000;
10
+ metricsSubject = new Subject();
14
11
  constructor() {
15
12
  const push2WebLensSource = {
16
13
  isGroupOwner: (groupId) => groupId === this.groupId,
@@ -27,20 +24,38 @@ export class Push2WebSDKExtension {
27
24
  return new ArrayBuffer(0);
28
25
  },
29
26
  };
30
- this.extension = createExtension().provides(ConcatInjectable(lensSourcesFactory.token, [configurationToken], (configuration) => {
31
- const handler = cameraKitServiceFetchHandlerFactory(configuration, fetch);
32
- const pageVisibility = new PageVisibility();
33
- const metricsHandler = new HandlerChainBuilder(handler).map(createRateLimitingHandler(this.metricRequestRateLimitMs, pageVisibility)).handler;
34
- this.metricsReporter = operationalMetricReporterFactory(metricsHandler, pageVisibility, configuration);
35
- return push2WebLensSource;
36
- }));
27
+ this.extension = createExtension().provides(ConcatInjectable(lensSourcesFactory.token, () => push2WebLensSource)).provides(Injectable(externalMetricsSubjectFactory.token, () => this.metricsSubject));
37
28
  }
38
29
  updateEnvelope(newEnvelope) {
39
30
  this.lastPushedEnvelope = newEnvelope;
40
31
  }
41
32
  reportEvent(events) {
42
- if (this.metricsReporter) {
43
- reportEvent(this.metricsReporter, events);
33
+ // Document which describes the operational metrics we send:
34
+ // https://docs.google.com/document/d/1wGadstNanzvB_7XYf7fMlQhsHi90p73CHtpD39r_d3g/edit?pli=1#
35
+ const { type } = events;
36
+ switch (type) {
37
+ case "error": {
38
+ const dimensions = {};
39
+ if (events.detail.name === "CommunicationError") {
40
+ dimensions['type'] = 'subscription';
41
+ dimensions['cause'] = events.detail.grpcStatus;
42
+ }
43
+ else if (events.detail.name === "LensExcludedError") {
44
+ dimensions['type'] = 'lens_excluded';
45
+ dimensions['cause'] = events.detail.cause.message;
46
+ }
47
+ this.metricsSubject.next(Count.count("push2web_error", 1, dimensions));
48
+ break;
49
+ }
50
+ case "lensReceived": {
51
+ this.metricsSubject.next(Count.count("push2web_received", 1));
52
+ break;
53
+ }
54
+ case "subscriptionChanged": // do not report subscription changed events
55
+ break;
56
+ default: {
57
+ assertUnreachable(type);
58
+ }
44
59
  }
45
60
  }
46
61
  }
@@ -2,7 +2,7 @@ import _m0 from "protobufjs/minimal";
2
2
  import { Lens } from "./lens";
3
3
  export declare const protobufPackage = "com.snap.camerakit.v3";
4
4
  export interface ExportLensesByIdRequest {
5
- unlockableIds: number[];
5
+ unlockableIds: string[];
6
6
  context: ExportLensesByIdRequest_Context | undefined;
7
7
  }
8
8
  export interface ExportLensesByIdRequest_Context {
@@ -27,16 +27,16 @@ export declare function exportLensesByIdRequest_Context_Extension_NameToJSON(obj
27
27
  export declare function exportLensesByIdRequest_Context_Extension_NameToNumber(object: ExportLensesByIdRequest_Context_Extension_Name): number;
28
28
  export interface ExportLensesByIdResponse {
29
29
  lenses: {
30
- [key: number]: Uint8Array;
30
+ [key: string]: Uint8Array;
31
31
  };
32
32
  excludedLenses: ExportLensesByIdResponse_ExcludedLens[];
33
33
  }
34
34
  export interface ExportLensesByIdResponse_LensesEntry {
35
- key: number;
35
+ key: string;
36
36
  value: Uint8Array;
37
37
  }
38
38
  export interface ExportLensesByIdResponse_ExcludedLens {
39
- lensId: number;
39
+ lensId: string;
40
40
  code: ExportLensesByIdResponse_ExcludedLens_Code;
41
41
  reason: string;
42
42
  }
@@ -64,7 +64,7 @@ export declare const ExportLensesByIdRequest: {
64
64
  fromJSON(object: any): ExportLensesByIdRequest;
65
65
  toJSON(message: ExportLensesByIdRequest): unknown;
66
66
  fromPartial<I extends {
67
- unlockableIds?: number[] | undefined;
67
+ unlockableIds?: string[] | undefined;
68
68
  context?: {
69
69
  userAgent?: string | undefined;
70
70
  locale?: string | undefined;
@@ -79,7 +79,7 @@ export declare const ExportLensesByIdRequest: {
79
79
  extensionRequestContext?: Uint8Array | undefined;
80
80
  } | undefined;
81
81
  } & {
82
- unlockableIds?: (number[] & number[] & Record<Exclude<keyof I["unlockableIds"], keyof number[]>, never>) | undefined;
82
+ unlockableIds?: (string[] & string[] & Record<Exclude<keyof I["unlockableIds"], keyof string[]>, never>) | undefined;
83
83
  context?: ({
84
84
  userAgent?: string | undefined;
85
85
  locale?: string | undefined;
@@ -167,33 +167,33 @@ export declare const ExportLensesByIdResponse: {
167
167
  toJSON(message: ExportLensesByIdResponse): unknown;
168
168
  fromPartial<I extends {
169
169
  lenses?: {
170
- [x: number]: Uint8Array | undefined;
170
+ [x: string]: Uint8Array | undefined;
171
171
  } | undefined;
172
172
  excludedLenses?: {
173
- lensId?: number | undefined;
173
+ lensId?: string | undefined;
174
174
  code?: ExportLensesByIdResponse_ExcludedLens_Code | undefined;
175
175
  reason?: string | undefined;
176
176
  }[] | undefined;
177
177
  } & {
178
178
  lenses?: ({
179
- [x: number]: Uint8Array | undefined;
179
+ [x: string]: Uint8Array | undefined;
180
180
  } & {
181
- [x: number]: Uint8Array | undefined;
182
- } & Record<Exclude<keyof I["lenses"], number>, never>) | undefined;
181
+ [x: string]: Uint8Array | undefined;
182
+ } & Record<Exclude<keyof I["lenses"], string | number>, never>) | undefined;
183
183
  excludedLenses?: ({
184
- lensId?: number | undefined;
184
+ lensId?: string | undefined;
185
185
  code?: ExportLensesByIdResponse_ExcludedLens_Code | undefined;
186
186
  reason?: string | undefined;
187
187
  }[] & ({
188
- lensId?: number | undefined;
188
+ lensId?: string | undefined;
189
189
  code?: ExportLensesByIdResponse_ExcludedLens_Code | undefined;
190
190
  reason?: string | undefined;
191
191
  } & {
192
- lensId?: number | undefined;
192
+ lensId?: string | undefined;
193
193
  code?: ExportLensesByIdResponse_ExcludedLens_Code | undefined;
194
194
  reason?: string | undefined;
195
195
  } & Record<Exclude<keyof I["excludedLenses"][number], keyof ExportLensesByIdResponse_ExcludedLens>, never>)[] & Record<Exclude<keyof I["excludedLenses"], keyof {
196
- lensId?: number | undefined;
196
+ lensId?: string | undefined;
197
197
  code?: ExportLensesByIdResponse_ExcludedLens_Code | undefined;
198
198
  reason?: string | undefined;
199
199
  }[]>, never>) | undefined;
@@ -204,10 +204,10 @@ export declare const ExportLensesByIdResponse_LensesEntry: {
204
204
  fromJSON(object: any): ExportLensesByIdResponse_LensesEntry;
205
205
  toJSON(message: ExportLensesByIdResponse_LensesEntry): unknown;
206
206
  fromPartial<I extends {
207
- key?: number | undefined;
207
+ key?: string | undefined;
208
208
  value?: Uint8Array | undefined;
209
209
  } & {
210
- key?: number | undefined;
210
+ key?: string | undefined;
211
211
  value?: Uint8Array | undefined;
212
212
  } & Record<Exclude<keyof I, keyof ExportLensesByIdResponse_LensesEntry>, never>>(object: I): ExportLensesByIdResponse_LensesEntry;
213
213
  };
@@ -216,11 +216,11 @@ export declare const ExportLensesByIdResponse_ExcludedLens: {
216
216
  fromJSON(object: any): ExportLensesByIdResponse_ExcludedLens;
217
217
  toJSON(message: ExportLensesByIdResponse_ExcludedLens): unknown;
218
218
  fromPartial<I extends {
219
- lensId?: number | undefined;
219
+ lensId?: string | undefined;
220
220
  code?: ExportLensesByIdResponse_ExcludedLens_Code | undefined;
221
221
  reason?: string | undefined;
222
222
  } & {
223
- lensId?: number | undefined;
223
+ lensId?: string | undefined;
224
224
  code?: ExportLensesByIdResponse_ExcludedLens_Code | undefined;
225
225
  reason?: string | undefined;
226
226
  } & Record<Exclude<keyof I, keyof ExportLensesByIdResponse_ExcludedLens>, never>>(object: I): ExportLensesByIdResponse_ExcludedLens;
@@ -137,11 +137,11 @@ export const ExportLensesByIdRequest = {
137
137
  if ((tag & 7) === 2) {
138
138
  const end2 = reader.uint32() + reader.pos;
139
139
  while (reader.pos < end2) {
140
- message.unlockableIds.push(longToNumber(reader.int64()));
140
+ message.unlockableIds.push(longToString(reader.int64()));
141
141
  }
142
142
  }
143
143
  else {
144
- message.unlockableIds.push(longToNumber(reader.int64()));
144
+ message.unlockableIds.push(longToString(reader.int64()));
145
145
  }
146
146
  break;
147
147
  case 2:
@@ -156,14 +156,14 @@ export const ExportLensesByIdRequest = {
156
156
  },
157
157
  fromJSON(object) {
158
158
  return {
159
- unlockableIds: Array.isArray(object?.unlockableIds) ? object.unlockableIds.map((e) => Number(e)) : [],
159
+ unlockableIds: Array.isArray(object?.unlockableIds) ? object.unlockableIds.map((e) => String(e)) : [],
160
160
  context: isSet(object.context) ? ExportLensesByIdRequest_Context.fromJSON(object.context) : undefined,
161
161
  };
162
162
  },
163
163
  toJSON(message) {
164
164
  const obj = {};
165
165
  if (message.unlockableIds) {
166
- obj.unlockableIds = message.unlockableIds.map((e) => Math.round(e));
166
+ obj.unlockableIds = message.unlockableIds.map((e) => e);
167
167
  }
168
168
  else {
169
169
  obj.unlockableIds = [];
@@ -344,7 +344,7 @@ export const ExportLensesByIdResponse = {
344
344
  return {
345
345
  lenses: isObject(object.lenses)
346
346
  ? Object.entries(object.lenses).reduce((acc, [key, value]) => {
347
- acc[Number(key)] = bytesFromBase64(value);
347
+ acc[key] = bytesFromBase64(value);
348
348
  return acc;
349
349
  }, {})
350
350
  : {},
@@ -373,7 +373,7 @@ export const ExportLensesByIdResponse = {
373
373
  const message = createBaseExportLensesByIdResponse();
374
374
  message.lenses = Object.entries(object.lenses ?? {}).reduce((acc, [key, value]) => {
375
375
  if (value !== undefined) {
376
- acc[Number(key)] = value;
376
+ acc[key] = value;
377
377
  }
378
378
  return acc;
379
379
  }, {});
@@ -383,7 +383,7 @@ export const ExportLensesByIdResponse = {
383
383
  },
384
384
  };
385
385
  function createBaseExportLensesByIdResponse_LensesEntry() {
386
- return { key: 0, value: new Uint8Array() };
386
+ return { key: "0", value: new Uint8Array() };
387
387
  }
388
388
  export const ExportLensesByIdResponse_LensesEntry = {
389
389
  decode(input, length) {
@@ -394,7 +394,7 @@ export const ExportLensesByIdResponse_LensesEntry = {
394
394
  const tag = reader.uint32();
395
395
  switch (tag >>> 3) {
396
396
  case 1:
397
- message.key = longToNumber(reader.int64());
397
+ message.key = longToString(reader.int64());
398
398
  break;
399
399
  case 2:
400
400
  message.value = reader.bytes();
@@ -408,26 +408,26 @@ export const ExportLensesByIdResponse_LensesEntry = {
408
408
  },
409
409
  fromJSON(object) {
410
410
  return {
411
- key: isSet(object.key) ? Number(object.key) : 0,
411
+ key: isSet(object.key) ? String(object.key) : "0",
412
412
  value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(),
413
413
  };
414
414
  },
415
415
  toJSON(message) {
416
416
  const obj = {};
417
- message.key !== undefined && (obj.key = Math.round(message.key));
417
+ message.key !== undefined && (obj.key = message.key);
418
418
  message.value !== undefined &&
419
419
  (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
420
420
  return obj;
421
421
  },
422
422
  fromPartial(object) {
423
423
  const message = createBaseExportLensesByIdResponse_LensesEntry();
424
- message.key = object.key ?? 0;
424
+ message.key = object.key ?? "0";
425
425
  message.value = object.value ?? new Uint8Array();
426
426
  return message;
427
427
  },
428
428
  };
429
429
  function createBaseExportLensesByIdResponse_ExcludedLens() {
430
- return { lensId: 0, code: ExportLensesByIdResponse_ExcludedLens_Code.UNSET, reason: "" };
430
+ return { lensId: "0", code: ExportLensesByIdResponse_ExcludedLens_Code.UNSET, reason: "" };
431
431
  }
432
432
  export const ExportLensesByIdResponse_ExcludedLens = {
433
433
  decode(input, length) {
@@ -438,7 +438,7 @@ export const ExportLensesByIdResponse_ExcludedLens = {
438
438
  const tag = reader.uint32();
439
439
  switch (tag >>> 3) {
440
440
  case 1:
441
- message.lensId = longToNumber(reader.int64());
441
+ message.lensId = longToString(reader.int64());
442
442
  break;
443
443
  case 2:
444
444
  message.code = exportLensesByIdResponse_ExcludedLens_CodeFromJSON(reader.int32());
@@ -455,7 +455,7 @@ export const ExportLensesByIdResponse_ExcludedLens = {
455
455
  },
456
456
  fromJSON(object) {
457
457
  return {
458
- lensId: isSet(object.lensId) ? Number(object.lensId) : 0,
458
+ lensId: isSet(object.lensId) ? String(object.lensId) : "0",
459
459
  code: isSet(object.code)
460
460
  ? exportLensesByIdResponse_ExcludedLens_CodeFromJSON(object.code)
461
461
  : ExportLensesByIdResponse_ExcludedLens_Code.UNSET,
@@ -464,14 +464,14 @@ export const ExportLensesByIdResponse_ExcludedLens = {
464
464
  },
465
465
  toJSON(message) {
466
466
  const obj = {};
467
- message.lensId !== undefined && (obj.lensId = Math.round(message.lensId));
467
+ message.lensId !== undefined && (obj.lensId = message.lensId);
468
468
  message.code !== undefined && (obj.code = exportLensesByIdResponse_ExcludedLens_CodeToJSON(message.code));
469
469
  message.reason !== undefined && (obj.reason = message.reason);
470
470
  return obj;
471
471
  },
472
472
  fromPartial(object) {
473
473
  const message = createBaseExportLensesByIdResponse_ExcludedLens();
474
- message.lensId = object.lensId ?? 0;
474
+ message.lensId = object.lensId ?? "0";
475
475
  message.code = object.code ?? ExportLensesByIdResponse_ExcludedLens_Code.UNSET;
476
476
  message.reason = object.reason ?? "";
477
477
  return message;
@@ -590,11 +590,8 @@ function base64FromBytes(arr) {
590
590
  }
591
591
  return btoa(bin.join(""));
592
592
  }
593
- function longToNumber(long) {
594
- if (long.gt(Number.MAX_SAFE_INTEGER)) {
595
- throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
596
- }
597
- return long.toNumber();
593
+ function longToString(long) {
594
+ return long.toString();
598
595
  }
599
596
  if (_m0.util.Long !== Long) {
600
597
  _m0.util.Long = Long;
@@ -21,7 +21,7 @@ export interface PushLensSubscriptionResponse_LensesEntry {
21
21
  value: Uint8Array;
22
22
  }
23
23
  export interface PushLensSubscriptionResponse_ExcludedLens {
24
- lensId: number;
24
+ lensId: string;
25
25
  code: PushLensSubscriptionResponse_ExcludedLens_Code;
26
26
  }
27
27
  export declare enum PushLensSubscriptionResponse_ExcludedLens_Code {
@@ -52,7 +52,7 @@ export interface ListenLensPushResponse_LensesEntry {
52
52
  value: Uint8Array;
53
53
  }
54
54
  export interface ListenLensPushResponse_ExcludedLens {
55
- lensId: number;
55
+ lensId: string;
56
56
  code: ListenLensPushResponse_ExcludedLens_Code;
57
57
  }
58
58
  export declare enum ListenLensPushResponse_ExcludedLens_Code {
@@ -131,7 +131,7 @@ export declare const PushLensSubscriptionResponse: {
131
131
  } | undefined;
132
132
  } | undefined;
133
133
  excludedLens?: {
134
- lensId?: number | undefined;
134
+ lensId?: string | undefined;
135
135
  code?: PushLensSubscriptionResponse_ExcludedLens_Code | undefined;
136
136
  } | undefined;
137
137
  heartbeat?: number | undefined;
@@ -287,10 +287,10 @@ export declare const PushLensSubscriptionResponse: {
287
287
  } & Record<Exclude<keyof I["lens"]["scannable"], keyof import("./lens").Scannable>, never>) | undefined;
288
288
  } & Record<Exclude<keyof I["lens"], keyof Lens>, never>) | undefined;
289
289
  excludedLens?: ({
290
- lensId?: number | undefined;
290
+ lensId?: string | undefined;
291
291
  code?: PushLensSubscriptionResponse_ExcludedLens_Code | undefined;
292
292
  } & {
293
- lensId?: number | undefined;
293
+ lensId?: string | undefined;
294
294
  code?: PushLensSubscriptionResponse_ExcludedLens_Code | undefined;
295
295
  } & Record<Exclude<keyof I["excludedLens"], keyof PushLensSubscriptionResponse_ExcludedLens>, never>) | undefined;
296
296
  heartbeat?: number | undefined;
@@ -318,10 +318,10 @@ export declare const PushLensSubscriptionResponse_ExcludedLens: {
318
318
  fromJSON(object: any): PushLensSubscriptionResponse_ExcludedLens;
319
319
  toJSON(message: PushLensSubscriptionResponse_ExcludedLens): unknown;
320
320
  fromPartial<I extends {
321
- lensId?: number | undefined;
321
+ lensId?: string | undefined;
322
322
  code?: PushLensSubscriptionResponse_ExcludedLens_Code | undefined;
323
323
  } & {
324
- lensId?: number | undefined;
324
+ lensId?: string | undefined;
325
325
  code?: PushLensSubscriptionResponse_ExcludedLens_Code | undefined;
326
326
  } & Record<Exclude<keyof I, keyof PushLensSubscriptionResponse_ExcludedLens>, never>>(object: I): PushLensSubscriptionResponse_ExcludedLens;
327
327
  };
@@ -344,7 +344,7 @@ export declare const ListenLensPushResponse: {
344
344
  toJSON(message: ListenLensPushResponse): unknown;
345
345
  fromPartial<I extends {
346
346
  excludedLens?: {
347
- lensId?: number | undefined;
347
+ lensId?: string | undefined;
348
348
  code?: ListenLensPushResponse_ExcludedLens_Code | undefined;
349
349
  } | undefined;
350
350
  heartbeat?: number | undefined;
@@ -353,10 +353,10 @@ export declare const ListenLensPushResponse: {
353
353
  } | undefined;
354
354
  } & {
355
355
  excludedLens?: ({
356
- lensId?: number | undefined;
356
+ lensId?: string | undefined;
357
357
  code?: ListenLensPushResponse_ExcludedLens_Code | undefined;
358
358
  } & {
359
- lensId?: number | undefined;
359
+ lensId?: string | undefined;
360
360
  code?: ListenLensPushResponse_ExcludedLens_Code | undefined;
361
361
  } & Record<Exclude<keyof I["excludedLens"], keyof ListenLensPushResponse_ExcludedLens>, never>) | undefined;
362
362
  heartbeat?: number | undefined;
@@ -384,10 +384,10 @@ export declare const ListenLensPushResponse_ExcludedLens: {
384
384
  fromJSON(object: any): ListenLensPushResponse_ExcludedLens;
385
385
  toJSON(message: ListenLensPushResponse_ExcludedLens): unknown;
386
386
  fromPartial<I extends {
387
- lensId?: number | undefined;
387
+ lensId?: string | undefined;
388
388
  code?: ListenLensPushResponse_ExcludedLens_Code | undefined;
389
389
  } & {
390
- lensId?: number | undefined;
390
+ lensId?: string | undefined;
391
391
  code?: ListenLensPushResponse_ExcludedLens_Code | undefined;
392
392
  } & Record<Exclude<keyof I, keyof ListenLensPushResponse_ExcludedLens>, never>>(object: I): ListenLensPushResponse_ExcludedLens;
393
393
  };