Skip to content

Commit 0c3f5ac

Browse files
committed
more renames
1 parent 0c001e3 commit 0c3f5ac

27 files changed

+67
-70
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
},
8585
{
8686
"path": "./build/releases/OneSignalSDK.page.es6.js",
87-
"limit": "46.281 kB",
87+
"limit": "46.241 kB",
8888
"gzip": true
8989
},
9090
{

src/core/executors/CustomEventOperationExecutor.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
import {
77
getResponseStatusType,
88
ResponseStatusType,
9-
} from 'src/shared/helpers/NetworkUtils';
9+
} from 'src/shared/helpers/network';
1010
import Log from 'src/shared/libraries/Log';
1111
import { VERSION } from 'src/shared/utils/env';
1212
import { OPERATION_NAME } from '../constants';
@@ -52,12 +52,12 @@ export class CustomEventsOperationExecutor implements IOperationExecutor {
5252
const response = await sendCustomEvent(
5353
{ appId: operation._appId },
5454
{
55-
name: operation.event.name,
55+
name: operation._event.name,
5656
onesignal_id: operation._onesignalId,
57-
external_id: operation.externalId,
58-
timestamp: operation.timestamp,
57+
external_id: operation._externalId,
58+
timestamp: operation._timestamp,
5959
payload: {
60-
...(operation.event.properties ?? {}),
60+
...(operation._event.properties ?? {}),
6161
os_sdk: this._eventMetadata,
6262
},
6363
},

src/core/executors/IdentityOperationExecutor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { IRebuildUserService } from 'src/core/types/user';
77
import {
88
getResponseStatusType,
99
ResponseStatusType,
10-
} from 'src/shared/helpers/NetworkUtils';
10+
} from 'src/shared/helpers/network';
1111
import Log from 'src/shared/libraries/Log';
1212
import { IdentityConstants, OPERATION_NAME } from '../constants';
1313
import { type IdentityModelStore } from '../modelStores/IdentityModelStore';

src/core/executors/LoginUserOperationExecutor.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { getTimeZoneId } from 'src/shared/helpers/general';
77
import {
88
getResponseStatusType,
99
ResponseStatusType,
10-
} from 'src/shared/helpers/NetworkUtils';
10+
} from 'src/shared/helpers/network';
1111
import Log from 'src/shared/libraries/Log';
1212
import { checkAndTriggerUserChanged } from 'src/shared/listeners';
1313
import { IdentityConstants, OPERATION_NAME } from '../constants';
@@ -80,22 +80,22 @@ export class LoginUserOperationExecutor implements IOperationExecutor {
8080
// When there is no existing user to attempt to associate with the externalId provided, we go right to
8181
// createUser. If there is no externalId provided this is an insert, if there is this will be an
8282
// "upsert with retrieval" as the user may already exist.
83-
if (!loginUserOp.existingOnesignalId || !loginUserOp.externalId) {
83+
if (!loginUserOp._existingOnesignalId || !loginUserOp._externalId) {
8484
return this._createUser(loginUserOp, operations);
8585
}
8686

8787
const result = await this._identityOperationExecutor._execute([
8888
new SetAliasOperation(
8989
loginUserOp._appId,
90-
loginUserOp.existingOnesignalId,
90+
loginUserOp._existingOnesignalId,
9191
IdentityConstants._ExternalID,
92-
loginUserOp.externalId,
92+
loginUserOp._externalId,
9393
),
9494
]);
9595

9696
switch (result._result) {
9797
case ExecutionResult._Success: {
98-
const backendOneSignalId = loginUserOp.existingOnesignalId;
98+
const backendOneSignalId = loginUserOp._existingOnesignalId;
9999
const opOneSignalId = loginUserOp._onesignalId;
100100

101101
if (this._identityModelStore._model._onesignalId === opOneSignalId) {
@@ -122,12 +122,12 @@ export class LoginUserOperationExecutor implements IOperationExecutor {
122122
}
123123

124124
case ExecutionResult._FailConflict:
125-
Log._debug(`Handling 409 for externalId: ${loginUserOp.externalId}`);
125+
Log._debug(`Handling 409 for externalId: ${loginUserOp._externalId}`);
126126
return this._createUser(loginUserOp, operations);
127127

128128
case ExecutionResult._FailNoretry:
129129
Log._error(
130-
`Recovering from SetAlias failure for externalId: ${loginUserOp.externalId}`,
130+
`Recovering from SetAlias failure for externalId: ${loginUserOp._externalId}`,
131131
);
132132
return this._createUser(loginUserOp, operations);
133133

@@ -147,8 +147,8 @@ export class LoginUserOperationExecutor implements IOperationExecutor {
147147
language: getLanguage(),
148148
};
149149

150-
if (createUserOperation.externalId) {
151-
identity[IdentityConstants._ExternalID] = createUserOperation.externalId;
150+
if (createUserOperation._externalId) {
151+
identity[IdentityConstants._ExternalID] = createUserOperation._externalId;
152152
}
153153

154154
for (const operation of operations) {

src/core/executors/RefreshUserOperationExecutor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
getResponseStatusType,
33
ResponseStatusType,
4-
} from 'src/shared/helpers/NetworkUtils';
4+
} from 'src/shared/helpers/network';
55
import { isPushSubscriptionType } from 'src/shared/helpers/subscription';
66
import Log from 'src/shared/libraries/Log';
77
import { NotificationType } from 'src/shared/subscriptions/constants';

src/core/executors/SubscriptionOperationExecutor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { IRebuildUserService } from 'src/core/types/user';
66
import {
77
getResponseStatusType,
88
ResponseStatusType,
9-
} from 'src/shared/helpers/NetworkUtils';
9+
} from 'src/shared/helpers/network';
1010
import Log from 'src/shared/libraries/Log';
1111
import { IdentityConstants, OPERATION_NAME } from '../constants';
1212
import { type SubscriptionModelStore } from '../modelStores/SubscriptionModelStore';

src/core/executors/UpdateUserOperationExecutor.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
getResponseStatusType,
33
ResponseStatusType,
4-
} from 'src/shared/helpers/NetworkUtils';
4+
} from 'src/shared/helpers/network';
55
import Log from 'src/shared/libraries/Log';
66
import { IdentityConstants, OPERATION_NAME } from '../constants';
77
import { type IPropertiesModelKeys } from '../models/PropertiesModel';
@@ -101,7 +101,7 @@ export class UpdateUserOperationExecutor implements IOperationExecutor {
101101

102102
const isTagProperty = (
103103
op: SetPropertyOperation,
104-
): op is SetPropertyOperation<'tags'> => op.property === 'tags';
104+
): op is SetPropertyOperation<'tags'> => op._property === 'tags';
105105

106106
if (ok) {
107107
if (this._identityModelStore._model._onesignalId === onesignalId) {
@@ -115,7 +115,7 @@ export class UpdateUserOperationExecutor implements IOperationExecutor {
115115
}
116116

117117
this._propertiesModelStore._model._setProperty(
118-
operation.property as IPropertiesModelKeys,
118+
operation._property as IPropertiesModelKeys,
119119
value,
120120
ModelChangeTags._Hydrate,
121121
);
@@ -175,7 +175,7 @@ function createPropertiesFromOperation(
175175
properties: PropertiesObject,
176176
): PropertiesObject {
177177
if (operation instanceof SetPropertyOperation) {
178-
const propertyKey = operation.property;
178+
const propertyKey = operation._property;
179179
const allowedKeys: IPropertiesModelKeys[] = [
180180
'ip',
181181
'tags',

src/core/operations/LoginUserOperation.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ export class LoginUserOperation extends Operation<ILoginOp> {
3333
existingOneSignalId?: string,
3434
) {
3535
super(OPERATION_NAME._LoginUser, appId, onesignalId);
36-
if (externalId) this.externalId = externalId;
37-
if (existingOneSignalId) this.existingOnesignalId = existingOneSignalId;
36+
if (externalId) this._externalId = externalId;
37+
if (existingOneSignalId) this._existingOnesignalId = existingOneSignalId;
3838
}
3939

4040
/**
4141
* The optional external ID of this newly logged-in user. Must be unique for the appId.
4242
*/
43-
get externalId(): string | undefined {
43+
get _externalId(): string | undefined {
4444
return this._getProperty('externalId');
4545
}
46-
private set externalId(value: string) {
46+
private set _externalId(value: string) {
4747
this._setProperty('externalId', value);
4848
}
4949

@@ -52,10 +52,10 @@ export class LoginUserOperation extends Operation<ILoginOp> {
5252
* When null (or non-null but unsuccessful), a new user will be upserted. This ID *may* be locally generated
5353
* and can be checked via IDManager.isLocalId to ensure correct processing.
5454
*/
55-
get existingOnesignalId(): string | undefined {
55+
get _existingOnesignalId(): string | undefined {
5656
return this._getProperty('existingOnesignalId');
5757
}
58-
private set existingOnesignalId(value: string) {
58+
private set _existingOnesignalId(value: string) {
5959
this._setProperty('existingOnesignalId', value);
6060
}
6161

@@ -73,18 +73,18 @@ export class LoginUserOperation extends Operation<ILoginOp> {
7373

7474
override get _canStartExecute(): boolean {
7575
return (
76-
!this.existingOnesignalId ||
77-
!IDManager._isLocalId(this.existingOnesignalId)
76+
!this._existingOnesignalId ||
77+
!IDManager._isLocalId(this._existingOnesignalId)
7878
);
7979
}
8080

8181
override get _applyToRecordId(): string {
82-
return this.existingOnesignalId ?? this._onesignalId;
82+
return this._existingOnesignalId ?? this._onesignalId;
8383
}
8484

8585
override _translateIds(map: Record<string, string>): void {
86-
if (this.existingOnesignalId && map[this.existingOnesignalId]) {
87-
this.existingOnesignalId = map[this.existingOnesignalId];
86+
if (this._existingOnesignalId && map[this._existingOnesignalId]) {
87+
this._existingOnesignalId = map[this._existingOnesignalId];
8888
}
8989
}
9090
}

src/core/operations/SetPropertyOperation.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ export class SetPropertyOperation<
3232
) {
3333
super(OPERATION_NAME._SetProperty, appId, onesignalId);
3434
if (property && value) {
35-
this.property = property;
35+
this._property = property;
3636
this.value = value;
3737
}
3838
}
3939

4040
/**
4141
* The property that is to be updated against the user.
4242
*/
43-
get property(): string {
43+
get _property(): string {
4444
return this._getProperty('property');
4545
}
46-
private set property(value: P) {
46+
private set _property(value: P) {
4747
this._setProperty('property', value);
4848
}
4949

src/core/operations/TrackCustomEventOperation.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,43 +27,43 @@ export class TrackCustomEventOperation extends Operation<ITrackEventOp> {
2727
constructor(props?: OperationProps);
2828
constructor(props: OperationProps) {
2929
super(OPERATION_NAME._CustomEvent, props?.appId, props?.onesignalId);
30-
if (props?.externalId) this.externalId = props.externalId;
31-
if (props?.timestamp) this.timestamp = props.timestamp;
32-
if (props?.event) this.event = props.event;
30+
if (props?.externalId) this._externalId = props.externalId;
31+
if (props?.timestamp) this._timestamp = props.timestamp;
32+
if (props?.event) this._event = props.event;
3333
}
3434

3535
/**
3636
* The external ID for the user, if available.
3737
*/
38-
get externalId(): string | undefined {
38+
get _externalId(): string | undefined {
3939
return this._getProperty('externalId');
4040
}
41-
private set externalId(value: string | undefined) {
41+
private set _externalId(value: string | undefined) {
4242
this._setProperty('externalId', value);
4343
}
4444

4545
/**
4646
* The timestamp when the event occurred.
4747
*/
48-
get timestamp(): string {
48+
get _timestamp(): string {
4949
return this._getProperty('timestamp');
5050
}
51-
private set timestamp(value: string) {
51+
private set _timestamp(value: string) {
5252
this._setProperty('timestamp', value);
5353
}
5454

5555
/**
5656
* The custom event instance containing the event name and properties.
5757
*/
58-
get event(): ICustomEvent {
58+
get _event(): ICustomEvent {
5959
return this._getProperty('event');
6060
}
61-
set event(value: ICustomEvent) {
61+
set _event(value: ICustomEvent) {
6262
this._setProperty('event', value);
6363
}
6464

6565
private get key(): string {
66-
return `${this._appId}.User.${this._onesignalId}.CustomEvent.${this.event.name}`;
66+
return `${this._appId}.User.${this._onesignalId}.CustomEvent.${this._event.name}`;
6767
}
6868

6969
override get _createComparisonKey(): string {

0 commit comments

Comments
 (0)