Skip to content

Commit 54e3784

Browse files
committed
rename more operation methods
1 parent 2acd6b9 commit 54e3784

34 files changed

+145
-140
lines changed

__test__/support/environment/TestEnvironmentHelpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const setupSubModelStore = async ({
9595
pushModel.web_p256 = web_p256;
9696
}
9797
await setPushToken(pushModel.token);
98-
OneSignal._coreDirector._subscriptionModelStore.replaceAll(
98+
OneSignal._coreDirector._subscriptionModelStore._replaceAll(
9999
[pushModel],
100100
ModelChangeTags.NO_PROPAGATE,
101101
);

__test__/support/helpers/setup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const setupIdentityModel = async (
6363
onesignalID: string = ONESIGNAL_ID,
6464
) => {
6565
const newIdentityModel = new IdentityModel();
66-
newIdentityModel.onesignalId = onesignalID;
66+
newIdentityModel._onesignalId = onesignalID;
6767
OneSignal._coreDirector._identityModelStore.replace(
6868
newIdentityModel,
6969
ModelChangeTags.NO_PROPAGATE,
@@ -126,7 +126,7 @@ export const setupSubscriptionModel = async (
126126
const subscriptionModel = new SubscriptionModel();
127127
subscriptionModel.id = id || '';
128128
subscriptionModel.token = token || '';
129-
OneSignal._coreDirector._subscriptionModelStore.replaceAll(
129+
OneSignal._coreDirector._subscriptionModelStore._replaceAll(
130130
[subscriptionModel],
131131
ModelChangeTags.NO_PROPAGATE,
132132
);

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": "47.694 kB",
87+
"limit": "47.64 kB",
8888
"gzip": true
8989
},
9090
{

src/core/controllers/CustomEventController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export class CustomEventController implements ICustomEventController {
2727

2828
const op = new TrackCustomEventOperation({
2929
appId,
30-
onesignalId: identityModel.onesignalId,
31-
externalId: identityModel.externalId,
30+
onesignalId: identityModel._onesignalId,
31+
externalId: identityModel._externalId,
3232
timestamp: new Date().toISOString(),
3333
event,
3434
});

src/core/executors/IdentityOperationExecutor.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe('IdentityOperationExecutor', () => {
6161
);
6262
getRebuildOpsSpy = vi.spyOn(
6363
rebuildUserService,
64-
'getRebuildOperationsIfCurrentUser',
64+
'_getRebuildOperationsIfCurrentUser',
6565
);
6666
});
6767

@@ -158,7 +158,7 @@ describe('IdentityOperationExecutor', () => {
158158
expect(res5.retryAfterSeconds).toBeUndefined();
159159

160160
// with rebuild ops
161-
identityModelStore.model.onesignalId = ONESIGNAL_ID;
161+
identityModelStore.model._onesignalId = ONESIGNAL_ID;
162162
const res7 = await executor._execute(ops);
163163
expect(res7.result).toBe(ExecutionResult.FAIL_RETRY);
164164
expect(res7.retryAfterSeconds).toBeUndefined();

src/core/executors/IdentityOperationExecutor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export class IdentityOperationExecutor implements IOperationExecutor {
9696
const { ok, status, retryAfterSeconds } = await request;
9797
if (ok) {
9898
if (
99-
this._identityModelStore.model.onesignalId ===
99+
this._identityModelStore.model._onesignalId ===
100100
lastOperation._onesignalId
101101
) {
102102
this._identityModelStore.model._setProperty(
@@ -147,7 +147,7 @@ export class IdentityOperationExecutor implements IOperationExecutor {
147147

148148
if (isSetAlias) {
149149
const rebuildOps =
150-
await this._buildUserService.getRebuildOperationsIfCurrentUser(
150+
await this._buildUserService._getRebuildOperationsIfCurrentUser(
151151
lastOperation._appId,
152152
lastOperation._onesignalId,
153153
);

src/core/executors/LoginUserOperationExecutor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class LoginUserOperationExecutor implements IOperationExecutor {
9898
const backendOneSignalId = loginUserOp.existingOnesignalId;
9999
const opOneSignalId = loginUserOp._onesignalId;
100100

101-
if (this._identityModelStore.model.onesignalId === opOneSignalId) {
101+
if (this._identityModelStore.model._onesignalId === opOneSignalId) {
102102
this._identityModelStore.model._setProperty(
103103
IdentityConstants.ONESIGNAL_ID,
104104
backendOneSignalId,
@@ -187,7 +187,7 @@ export class LoginUserOperationExecutor implements IOperationExecutor {
187187
[createUserOperation._onesignalId]: backendOneSignalId,
188188
};
189189

190-
if (this._identityModelStore.model.onesignalId === opOneSignalId) {
190+
if (this._identityModelStore.model._onesignalId === opOneSignalId) {
191191
this._identityModelStore.model._setProperty(
192192
IdentityConstants.ONESIGNAL_ID,
193193
backendOneSignalId,

src/core/executors/RefreshUserOperationExecutor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('RefreshUserOperationExecutor', () => {
5858
);
5959
getRebuildOpsSpy = vi.spyOn(
6060
buildUserService,
61-
'getRebuildOperationsIfCurrentUser',
61+
'_getRebuildOperationsIfCurrentUser',
6262
);
6363
});
6464

src/core/executors/RefreshUserOperationExecutor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class RefreshUserOperationExecutor implements IOperationExecutor {
7878

7979
const { ok, result, retryAfterSeconds, status } = response;
8080
if (ok) {
81-
if (op._onesignalId !== this._identityModelStore.model.onesignalId) {
81+
if (op._onesignalId !== this._identityModelStore.model._onesignalId) {
8282
return new ExecutionResponse(ExecutionResult.SUCCESS);
8383
}
8484

@@ -131,7 +131,7 @@ export class RefreshUserOperationExecutor implements IOperationExecutor {
131131
propertiesModel,
132132
ModelChangeTags.HYDRATE,
133133
);
134-
this._subscriptionsModelStore.replaceAll(
134+
this._subscriptionsModelStore._replaceAll(
135135
subscriptionModels,
136136
ModelChangeTags.HYDRATE,
137137
);
@@ -162,7 +162,7 @@ export class RefreshUserOperationExecutor implements IOperationExecutor {
162162
);
163163

164164
const rebuildOps =
165-
await this._buildUserService.getRebuildOperationsIfCurrentUser(
165+
await this._buildUserService._getRebuildOperationsIfCurrentUser(
166166
op._appId,
167167
op._onesignalId,
168168
);

src/core/executors/SubscriptionOperationExecutor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('SubscriptionOperationExecutor', () => {
7070
);
7171
getRebuildOpsSpy = vi.spyOn(
7272
buildUserService,
73-
'getRebuildOperationsIfCurrentUser',
73+
'_getRebuildOperationsIfCurrentUser',
7474
);
7575
});
7676

0 commit comments

Comments
 (0)