Skip to content

Commit 6a914b8

Browse files
committed
more renames
1 parent 40afa05 commit 6a914b8

File tree

58 files changed

+152
-151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+152
-151
lines changed

__test__/support/helpers/executors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class SomeOperation extends Operation {
1818
}
1919

2020
get _groupComparisonType() {
21-
return GroupComparisonType.CREATE;
21+
return GroupComparisonType._Create;
2222
}
2323

2424
get _canStartExecute() {

__test__/unit/http/sdkVersion.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('Sdk Version Header Tests', () => {
4646
getUserByAlias(
4747
{ appId: APP_ID },
4848
{
49-
label: IdentityConstants.EXTERNAL_ID,
49+
label: IdentityConstants._ExternalID,
5050
id: EXTERNAL_ID,
5151
},
5252
);
@@ -57,7 +57,7 @@ describe('Sdk Version Header Tests', () => {
5757
updateUserByAlias(
5858
{ appId: APP_ID },
5959
{
60-
label: IdentityConstants.EXTERNAL_ID,
60+
label: IdentityConstants._ExternalID,
6161
id: EXTERNAL_ID,
6262
},
6363
{},
@@ -69,7 +69,7 @@ describe('Sdk Version Header Tests', () => {
6969
updateUserByAlias(
7070
{ appId: APP_ID, subscriptionId: SUB_ID },
7171
{
72-
label: IdentityConstants.EXTERNAL_ID,
72+
label: IdentityConstants._ExternalID,
7373
id: EXTERNAL_ID,
7474
},
7575
{},
@@ -81,7 +81,7 @@ describe('Sdk Version Header Tests', () => {
8181
deleteUserByAlias(
8282
{ appId: APP_ID },
8383
{
84-
label: IdentityConstants.EXTERNAL_ID,
84+
label: IdentityConstants._ExternalID,
8585
id: EXTERNAL_ID,
8686
},
8787
);
@@ -92,7 +92,7 @@ describe('Sdk Version Header Tests', () => {
9292
createSubscriptionByAlias(
9393
{ appId: APP_ID },
9494
{
95-
label: IdentityConstants.EXTERNAL_ID,
95+
label: IdentityConstants._ExternalID,
9696
id: EXTERNAL_ID,
9797
},
9898
{
@@ -107,7 +107,7 @@ describe('Sdk Version Header Tests', () => {
107107
getUserIdentity(
108108
{ appId: APP_ID },
109109
{
110-
label: IdentityConstants.EXTERNAL_ID,
110+
label: IdentityConstants._ExternalID,
111111
id: EXTERNAL_ID,
112112
},
113113
);
@@ -118,10 +118,10 @@ describe('Sdk Version Header Tests', () => {
118118
deleteAlias(
119119
{ appId: APP_ID },
120120
{
121-
label: IdentityConstants.EXTERNAL_ID,
121+
label: IdentityConstants._ExternalID,
122122
id: EXTERNAL_ID,
123123
},
124-
IdentityConstants.EXTERNAL_ID,
124+
IdentityConstants._ExternalID,
125125
);
126126
expectHeaderToBeSent();
127127
});

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

src/core/constants.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
export const OPERATION_NAME = {
22
// Identity Operations
3-
SET_ALIAS: 'set-alias',
4-
DELETE_ALIAS: 'delete-alias',
3+
_SetAlias: 'set-alias',
4+
_DeleteAlias: 'delete-alias',
55

66
// Property Operations
7-
SET_PROPERTY: 'set-property',
7+
_SetProperty: 'set-property',
88

99
// User Operations
10-
REFRESH_USER: 'refresh-user',
11-
LOGIN_USER: 'login-user',
10+
_RefreshUser: 'refresh-user',
11+
_LoginUser: 'login-user',
1212

1313
// Subscription Operations
14-
CREATE_SUBSCRIPTION: 'create-subscription',
15-
UPDATE_SUBSCRIPTION: 'update-subscription',
16-
DELETE_SUBSCRIPTION: 'delete-subscription',
17-
TRANSFER_SUBSCRIPTION: 'transfer-subscription',
14+
_CreateSubscription: 'create-subscription',
15+
_UpdateSubscription: 'update-subscription',
16+
_DeleteSubscription: 'delete-subscription',
17+
_TransferSubscription: 'transfer-subscription',
1818

1919
// Custom Events Operations
20-
CUSTOM_EVENT: 'custom-event',
20+
_CustomEvent: 'custom-event',
2121
} as const;
2222

2323
export const IdentityConstants = {
2424
/**
2525
* The alias label for the external ID alias.
2626
*/
27-
EXTERNAL_ID: 'external_id',
27+
_ExternalID: 'external_id',
2828

2929
/**
3030
* The alias label for the internal OneSignal ID alias.
3131
*/
32-
ONESIGNAL_ID: 'onesignal_id',
32+
_OneSignalID: 'onesignal_id',
3333
} as const;

src/core/executors/CustomEventOperationExecutor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
ResponseStatusType,
99
} from 'src/shared/helpers/NetworkUtils';
1010
import Log from 'src/shared/libraries/Log';
11-
import { VERSION } from 'src/shared/utils/EnvVariables';
11+
import { VERSION } from 'src/shared/utils/env';
1212
import { OPERATION_NAME } from '../constants';
1313
import { ExecutionResponse } from '../operations/ExecutionResponse';
1414
import { Operation } from '../operations/Operation';
@@ -21,7 +21,7 @@ import { ExecutionResult, type IOperationExecutor } from '../types/operation';
2121
// Reference: https://github.com/OneSignal/OneSignal-Android-SDK/blob/main/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/user/internal/operations/impl/executors/CustomEventOperationExecutor.kt
2222
export class CustomEventsOperationExecutor implements IOperationExecutor {
2323
get _operations(): string[] {
24-
return [OPERATION_NAME.CUSTOM_EVENT];
24+
return [OPERATION_NAME._CustomEvent];
2525
}
2626

2727
private get _eventMetadata(): ICustomEventMetadata {

src/core/executors/IdentityOperationExecutor.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ describe('IdentityOperationExecutor', () => {
6969
const executor = getExecutor();
7070

7171
expect(executor._operations).toEqual([
72-
OPERATION_NAME.SET_ALIAS,
73-
OPERATION_NAME.DELETE_ALIAS,
72+
OPERATION_NAME._SetAlias,
73+
OPERATION_NAME._DeleteAlias,
7474
]);
7575
});
7676

src/core/executors/IdentityOperationExecutor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class IdentityOperationExecutor implements IOperationExecutor {
3636
}
3737

3838
get _operations(): string[] {
39-
return [OPERATION_NAME.SET_ALIAS, OPERATION_NAME.DELETE_ALIAS];
39+
return [OPERATION_NAME._SetAlias, OPERATION_NAME._DeleteAlias];
4040
}
4141

4242
async _execute(operations: Operation[]): Promise<ExecutionResponse> {
@@ -79,15 +79,15 @@ export class IdentityOperationExecutor implements IOperationExecutor {
7979
? addAlias(
8080
{ appId: lastOperation._appId },
8181
{
82-
label: IdentityConstants.ONESIGNAL_ID,
82+
label: IdentityConstants._OneSignalID,
8383
id: lastOperation._onesignalId,
8484
},
8585
{ [lastOperation.label]: lastOperation.value },
8686
)
8787
: deleteAlias(
8888
{ appId: lastOperation._appId },
8989
{
90-
label: IdentityConstants.ONESIGNAL_ID,
90+
label: IdentityConstants._OneSignalID,
9191
id: lastOperation._onesignalId,
9292
},
9393
lastOperation.label,

src/core/executors/LoginUserOperationExecutor.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe('LoginUserOperationExecutor', () => {
8686
test('should return correct operations (names)', async () => {
8787
const executor = getExecutor();
8888

89-
expect(executor._operations).toEqual([OPERATION_NAME.LOGIN_USER]);
89+
expect(executor._operations).toEqual([OPERATION_NAME._LoginUser]);
9090
});
9191

9292
test('should validate operations', async () => {
@@ -194,7 +194,7 @@ describe('LoginUserOperationExecutor', () => {
194194

195195
// should update model properties
196196
expect(
197-
identityModelStore.model._getProperty(IdentityConstants.ONESIGNAL_ID),
197+
identityModelStore.model._getProperty(IdentityConstants._OneSignalID),
198198
).toEqual(ONESIGNAL_ID_2);
199199
expect(propertiesModelStore.model._getProperty('onesignalId')).toEqual(
200200
ONESIGNAL_ID_2,
@@ -271,7 +271,7 @@ describe('LoginUserOperationExecutor', () => {
271271

272272
// should update model properties
273273
expect(
274-
identityModelStore.model._getProperty(IdentityConstants.ONESIGNAL_ID),
274+
identityModelStore.model._getProperty(IdentityConstants._OneSignalID),
275275
).toEqual(ONESIGNAL_ID_2);
276276
expect(propertiesModelStore.model._getProperty('onesignalId')).toEqual(
277277
ONESIGNAL_ID_2,

src/core/executors/LoginUserOperationExecutor.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class LoginUserOperationExecutor implements IOperationExecutor {
5858
}
5959

6060
get _operations(): string[] {
61-
return [OPERATION_NAME.LOGIN_USER];
61+
return [OPERATION_NAME._LoginUser];
6262
}
6363

6464
async _execute(operations: Operation[]): Promise<ExecutionResponse> {
@@ -88,7 +88,7 @@ export class LoginUserOperationExecutor implements IOperationExecutor {
8888
new SetAliasOperation(
8989
loginUserOp._appId,
9090
loginUserOp.existingOnesignalId,
91-
IdentityConstants.EXTERNAL_ID,
91+
IdentityConstants._ExternalID,
9292
loginUserOp.externalId,
9393
),
9494
]);
@@ -100,7 +100,7 @@ export class LoginUserOperationExecutor implements IOperationExecutor {
100100

101101
if (this._identityModelStore.model._onesignalId === opOneSignalId) {
102102
this._identityModelStore.model._setProperty(
103-
IdentityConstants.ONESIGNAL_ID,
103+
IdentityConstants._OneSignalID,
104104
backendOneSignalId,
105105
ModelChangeTags.HYDRATE,
106106
);
@@ -150,7 +150,7 @@ export class LoginUserOperationExecutor implements IOperationExecutor {
150150
};
151151

152152
if (createUserOperation.externalId) {
153-
identity[IdentityConstants.EXTERNAL_ID] = createUserOperation.externalId;
153+
identity[IdentityConstants._ExternalID] = createUserOperation.externalId;
154154
}
155155

156156
for (const operation of operations) {
@@ -189,7 +189,7 @@ export class LoginUserOperationExecutor implements IOperationExecutor {
189189

190190
if (this._identityModelStore.model._onesignalId === opOneSignalId) {
191191
this._identityModelStore.model._setProperty(
192-
IdentityConstants.ONESIGNAL_ID,
192+
IdentityConstants._OneSignalID,
193193
backendOneSignalId,
194194
ModelChangeTags.HYDRATE,
195195
);

src/core/executors/RefreshUserOperationExecutor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe('RefreshUserOperationExecutor', () => {
7474

7575
test('should return correct operations (names)', async () => {
7676
const executor = getExecutor();
77-
expect(executor._operations).toEqual([OPERATION_NAME.REFRESH_USER]);
77+
expect(executor._operations).toEqual([OPERATION_NAME._RefreshUser]);
7878
});
7979

8080
test('should validate operations', async () => {

0 commit comments

Comments
 (0)