@onesignal/node-onesignal 5.0.0-alpha-02 → 5.2.0-beta1
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/.github/ISSUE_TEMPLATE/ask-question.yml +3 -3
- package/.github/ISSUE_TEMPLATE/bug-report.yml +2 -2
- package/.github/ISSUE_TEMPLATE/general-feedback.yml +3 -3
- package/.github/workflows/asana-add-comment.yml +47 -0
- package/.github/workflows/asana-create-task.yml +119 -0
- package/.github/workflows/asana-update-issue.yml +172 -0
- package/.github/workflows/project.yml +17 -0
- package/DefaultApi.md +4 -4
- package/README.md +6 -6
- package/apis/DefaultApi.ts +34 -34
- package/auth/auth.ts +16 -16
- package/configuration.ts +5 -5
- package/dist/apis/DefaultApi.js +34 -34
- package/dist/apis/DefaultApi.js.map +1 -1
- package/dist/auth/auth.d.ts +4 -4
- package/dist/auth/auth.js +20 -20
- package/dist/auth/auth.js.map +1 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +4 -4
- package/dist/configuration.js.map +1 -1
- package/dist/http/isomorphic-fetch.js +1 -2
- package/dist/http/isomorphic-fetch.js.map +1 -1
- package/dist/models/BasicNotification.d.ts +2 -0
- package/dist/models/BasicNotification.js +12 -0
- package/dist/models/BasicNotification.js.map +1 -1
- package/dist/models/BasicNotificationAllOf.d.ts +2 -0
- package/dist/models/BasicNotificationAllOf.js +12 -0
- package/dist/models/BasicNotificationAllOf.js.map +1 -1
- package/dist/models/Notification.d.ts +2 -0
- package/dist/models/Notification.js +12 -0
- package/dist/models/Notification.js.map +1 -1
- package/dist/models/NotificationWithMeta.d.ts +2 -0
- package/dist/models/NotificationWithMeta.js +12 -0
- package/dist/models/NotificationWithMeta.js.map +1 -1
- package/dist/models/ObjectSerializer.d.ts +0 -1
- package/dist/models/ObjectSerializer.js +0 -3
- package/dist/models/ObjectSerializer.js.map +1 -1
- package/dist/models/all.d.ts +0 -1
- package/dist/models/all.js +0 -1
- package/dist/models/all.js.map +1 -1
- package/dist/types/ObjectParamAPI.js.map +1 -1
- package/dist/types/ObservableAPI.js.map +1 -1
- package/dist/types/PromiseAPI.js.map +1 -1
- package/http/isomorphic-fetch.ts +0 -1
- package/models/App.ts +1 -1
- package/models/BasicNotification.ts +22 -2
- package/models/BasicNotificationAllOf.ts +22 -2
- package/models/BasicNotificationAllOfAndroidBackgroundLayout.ts +1 -1
- package/models/Button.ts +1 -1
- package/models/CreateNotificationSuccessResponse.ts +1 -1
- package/models/CreateSegmentConflictResponse.ts +1 -1
- package/models/CreateSegmentSuccessResponse.ts +1 -1
- package/models/CreateUserConflictResponse.ts +1 -1
- package/models/CreateUserConflictResponseErrorsInner.ts +1 -1
- package/models/CreateUserConflictResponseErrorsItemsMeta.ts +1 -1
- package/models/DeliveryData.ts +1 -1
- package/models/ExportEventsSuccessResponse.ts +1 -1
- package/models/ExportSubscriptionsRequestBody.ts +1 -1
- package/models/ExportSubscriptionsSuccessResponse.ts +1 -1
- package/models/Filter.ts +1 -1
- package/models/FilterExpression.ts +1 -1
- package/models/GenericError.ts +1 -1
- package/models/GenericSuccessBoolResponse.ts +1 -1
- package/models/GetNotificationHistoryRequestBody.ts +1 -1
- package/models/GetSegmentsSuccessResponse.ts +1 -1
- package/models/LanguageStringMap.ts +1 -1
- package/models/Notification.ts +22 -2
- package/models/NotificationAllOf.ts +1 -1
- package/models/NotificationHistorySuccessResponse.ts +1 -1
- package/models/NotificationSlice.ts +1 -1
- package/models/NotificationTarget.ts +1 -1
- package/models/NotificationWithMeta.ts +22 -2
- package/models/NotificationWithMetaAllOf.ts +1 -1
- package/models/ObjectSerializer.ts +4 -7
- package/models/Operator.ts +1 -1
- package/models/OutcomeData.ts +1 -1
- package/models/OutcomesData.ts +1 -1
- package/models/PlatformDeliveryData.ts +1 -1
- package/models/PlatformDeliveryDataEmailAllOf.ts +1 -1
- package/models/PlatformDeliveryDataSmsAllOf.ts +1 -1
- package/models/PropertiesBody.ts +1 -1
- package/models/PropertiesDeltas.ts +1 -1
- package/models/PropertiesObject.ts +1 -1
- package/models/Purchase.ts +1 -1
- package/models/RateLimitError.ts +1 -1
- package/models/Segment.ts +1 -1
- package/models/SegmentData.ts +1 -1
- package/models/SegmentNotificationTarget.ts +1 -1
- package/models/Subscription.ts +1 -1
- package/models/SubscriptionBody.ts +1 -1
- package/models/SubscriptionNotificationTarget.ts +1 -1
- package/models/TransferSubscriptionRequestBody.ts +1 -1
- package/models/UpdateLiveActivityRequest.ts +1 -1
- package/models/UpdateLiveActivitySuccessResponse.ts +1 -1
- package/models/UpdateUserRequest.ts +1 -1
- package/models/User.ts +1 -1
- package/models/UserIdentityBody.ts +1 -1
- package/models/WebButton.ts +1 -1
- package/models/all.ts +0 -1
- package/package.json +2 -4
- package/types/ObjectParamAPI.ts +0 -1
- package/types/ObservableAPI.ts +0 -1
- package/types/PromiseAPI.ts +0 -1
- package/.github/workflows/Zapier.yml +0 -34
- package/dist/jest.config.d.ts +0 -15
- package/dist/jest.config.js +0 -17
- package/dist/jest.config.js.map +0 -1
- package/dist/models/BeginLiveActivityRequest.d.ts +0 -18
- package/dist/models/BeginLiveActivityRequest.js +0 -28
- package/dist/models/BeginLiveActivityRequest.js.map +0 -1
- package/dist/models/CancelNotificationSuccessResponse.d.ts +0 -17
- package/dist/models/CancelNotificationSuccessResponse.js +0 -22
- package/dist/models/CancelNotificationSuccessResponse.js.map +0 -1
- package/dist/models/CreatePlayerSuccessResponse.d.ts +0 -18
- package/dist/models/CreatePlayerSuccessResponse.js +0 -28
- package/dist/models/CreatePlayerSuccessResponse.js.map +0 -1
- package/dist/models/CreateSubscriptionRequestBody.d.ts +0 -19
- package/dist/models/CreateSubscriptionRequestBody.js +0 -28
- package/dist/models/CreateSubscriptionRequestBody.js.map +0 -1
- package/dist/models/DeletePlayerNotFoundResponse.d.ts +0 -17
- package/dist/models/DeletePlayerNotFoundResponse.js +0 -22
- package/dist/models/DeletePlayerNotFoundResponse.js.map +0 -1
- package/dist/models/DeletePlayerSuccessResponse.d.ts +0 -17
- package/dist/models/DeletePlayerSuccessResponse.js +0 -22
- package/dist/models/DeletePlayerSuccessResponse.js.map +0 -1
- package/dist/models/DeleteSegmentNotFoundResponse.d.ts +0 -17
- package/dist/models/DeleteSegmentNotFoundResponse.js +0 -22
- package/dist/models/DeleteSegmentNotFoundResponse.js.map +0 -1
- package/dist/models/DeleteSegmentSuccessResponse.d.ts +0 -17
- package/dist/models/DeleteSegmentSuccessResponse.js +0 -22
- package/dist/models/DeleteSegmentSuccessResponse.js.map +0 -1
- package/dist/models/ExportPlayersRequestBody.d.ts +0 -19
- package/dist/models/ExportPlayersRequestBody.js +0 -34
- package/dist/models/ExportPlayersRequestBody.js.map +0 -1
- package/dist/models/ExportPlayersSuccessResponse.d.ts +0 -17
- package/dist/models/ExportPlayersSuccessResponse.js +0 -22
- package/dist/models/ExportPlayersSuccessResponse.js.map +0 -1
- package/dist/models/FilterExpressions.d.ts +0 -23
- package/dist/models/FilterExpressions.js +0 -46
- package/dist/models/FilterExpressions.js.map +0 -1
- package/dist/models/GenericErrorErrorsInner.d.ts +0 -18
- package/dist/models/GenericErrorErrorsInner.js +0 -28
- package/dist/models/GenericErrorErrorsInner.js.map +0 -1
- package/dist/models/GetNotificationRequestBody.d.ts +0 -20
- package/dist/models/GetNotificationRequestBody.js +0 -34
- package/dist/models/GetNotificationRequestBody.js.map +0 -1
- package/dist/models/InlineResponse200.d.ts +0 -19
- package/dist/models/InlineResponse200.js +0 -22
- package/dist/models/InlineResponse200.js.map +0 -1
- package/dist/models/InlineResponse2003.d.ts +0 -17
- package/dist/models/InlineResponse2003.js +0 -22
- package/dist/models/InlineResponse2003.js.map +0 -1
- package/dist/models/InlineResponse201.d.ts +0 -18
- package/dist/models/InlineResponse201.js +0 -22
- package/dist/models/InlineResponse201.js.map +0 -1
- package/dist/models/InlineResponse202.d.ts +0 -18
- package/dist/models/InlineResponse202.js +0 -22
- package/dist/models/InlineResponse202.js.map +0 -1
- package/dist/models/InvalidIdentifierError.d.ts +0 -18
- package/dist/models/InvalidIdentifierError.js +0 -28
- package/dist/models/InvalidIdentifierError.js.map +0 -1
- package/dist/models/Notification200Errors.d.ts +0 -18
- package/dist/models/Notification200Errors.js +0 -28
- package/dist/models/Notification200Errors.js.map +0 -1
- package/dist/models/Player.d.ts +0 -43
- package/dist/models/Player.js +0 -178
- package/dist/models/Player.js.map +0 -1
- package/dist/models/PlayerNotificationTarget.d.ts +0 -30
- package/dist/models/PlayerNotificationTarget.js +0 -88
- package/dist/models/PlayerNotificationTarget.js.map +0 -1
- package/dist/models/PlayerNotificationTargetIncludeAliases.d.ts +0 -17
- package/dist/models/PlayerNotificationTargetIncludeAliases.js +0 -22
- package/dist/models/PlayerNotificationTargetIncludeAliases.js.map +0 -1
- package/dist/models/PlayerSlice.d.ts +0 -21
- package/dist/models/PlayerSlice.js +0 -40
- package/dist/models/PlayerSlice.js.map +0 -1
- package/dist/models/RateLimiterError.d.ts +0 -18
- package/dist/models/RateLimiterError.js +0 -22
- package/dist/models/RateLimiterError.js.map +0 -1
- package/dist/models/StringMap.d.ts +0 -59
- package/dist/models/StringMap.js +0 -274
- package/dist/models/StringMap.js.map +0 -1
- package/dist/models/SubscriptionObject.d.ts +0 -34
- package/dist/models/SubscriptionObject.js +0 -118
- package/dist/models/SubscriptionObject.js.map +0 -1
- package/dist/models/UpdatePlayerSuccessResponse.d.ts +0 -17
- package/dist/models/UpdatePlayerSuccessResponse.js +0 -22
- package/dist/models/UpdatePlayerSuccessResponse.js.map +0 -1
- package/dist/models/UpdatePlayerTagsRequestBody.d.ts +0 -17
- package/dist/models/UpdatePlayerTagsRequestBody.js +0 -22
- package/dist/models/UpdatePlayerTagsRequestBody.js.map +0 -1
- package/dist/models/UpdatePlayerTagsSuccessResponse.d.ts +0 -17
- package/dist/models/UpdatePlayerTagsSuccessResponse.js +0 -22
- package/dist/models/UpdatePlayerTagsSuccessResponse.js.map +0 -1
- package/dist/models/UpdateSubscriptionRequestBody.d.ts +0 -18
- package/dist/models/UpdateSubscriptionRequestBody.js +0 -22
- package/dist/models/UpdateSubscriptionRequestBody.js.map +0 -1
- package/dist/models/UserIdentityRequestBody.d.ts +0 -19
- package/dist/models/UserIdentityRequestBody.js +0 -22
- package/dist/models/UserIdentityRequestBody.js.map +0 -1
- package/dist/models/UserIdentityResponse.d.ts +0 -19
- package/dist/models/UserIdentityResponse.js +0 -22
- package/dist/models/UserIdentityResponse.js.map +0 -1
- package/dist/models/UserSubscriptionOptions.d.ts +0 -17
- package/dist/models/UserSubscriptionOptions.js +0 -22
- package/dist/models/UserSubscriptionOptions.js.map +0 -1
- package/dist/test/DefaultApi.test.d.ts +0 -1
- package/dist/test/DefaultApi.test.js +0 -49
- package/dist/test/DefaultApi.test.js.map +0 -1
- package/models/GenericErrorErrorsInner.ts +0 -38
- package/models/InvalidIdentifierError.ts +0 -44
- package/models/RateLimiterError.ts +0 -32
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
name: 🙋♂️ Ask a question
|
|
2
2
|
description: Tell us what's on your mind
|
|
3
|
-
title: "[
|
|
4
|
-
labels: ["
|
|
3
|
+
title: "[Question]: "
|
|
4
|
+
labels: ["Question"]
|
|
5
5
|
body:
|
|
6
6
|
- type: markdown
|
|
7
7
|
attributes:
|
|
@@ -22,4 +22,4 @@ body:
|
|
|
22
22
|
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/api/blob/main/CONTRIBUTING.md)
|
|
23
23
|
options:
|
|
24
24
|
- label: I agree to follow this project's Code of Conduct
|
|
25
|
-
required: true
|
|
25
|
+
required: true
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
name: 🪳 Bug report
|
|
2
2
|
description: File a bug report
|
|
3
3
|
title: "[Bug]: "
|
|
4
|
-
labels: ["
|
|
4
|
+
labels: ["Bug"]
|
|
5
5
|
body:
|
|
6
6
|
- type: markdown
|
|
7
7
|
attributes:
|
|
@@ -48,4 +48,4 @@ body:
|
|
|
48
48
|
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/api/blob/main/CONTRIBUTING.md)
|
|
49
49
|
options:
|
|
50
50
|
- label: I agree to follow this project's Code of Conduct
|
|
51
|
-
required: true
|
|
51
|
+
required: true
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
name: 📣 General feedback
|
|
2
2
|
description: Tell us what's on your mind
|
|
3
|
-
title: "[
|
|
4
|
-
labels: ["
|
|
3
|
+
title: "[Feedback]: "
|
|
4
|
+
labels: ["Feedback"]
|
|
5
5
|
body:
|
|
6
6
|
- type: markdown
|
|
7
7
|
attributes:
|
|
@@ -22,4 +22,4 @@ body:
|
|
|
22
22
|
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/api/blob/main/CONTRIBUTING.md)
|
|
23
23
|
options:
|
|
24
24
|
- label: I agree to follow this project's Code of Conduct
|
|
25
|
-
required: true
|
|
25
|
+
required: true
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Github --> Asana Add Comment Workflow
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issue_comment:
|
|
5
|
+
types: [created]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
issues: read
|
|
13
|
+
steps:
|
|
14
|
+
- name: Get Asana Task Corresponding to Issue
|
|
15
|
+
env:
|
|
16
|
+
ISSUE_ID: ${{ github.event.issue.id }}
|
|
17
|
+
REPO_FULL_NAME: ${{ github.event.repository.full_name }}
|
|
18
|
+
WORKSPACE_ID: "780103692902078"
|
|
19
|
+
run: |
|
|
20
|
+
REPO_SCOPED_ISSUE_ID="$REPO_FULL_NAME#$ISSUE_ID"
|
|
21
|
+
|
|
22
|
+
curl --request GET \
|
|
23
|
+
--url "https://app.asana.com/api/1.0/workspaces/$WORKSPACE_ID/tasks/search?opt_fields=notes&text=$REPO_SCOPED_ISSUE_ID&sort_by=modified_at&sort_ascending=false" \
|
|
24
|
+
--header 'accept: application/json' \
|
|
25
|
+
--header 'authorization: Bearer ${{ secrets.ASANA_PAT }}' \
|
|
26
|
+
--output response.json
|
|
27
|
+
TASK_GID=$(jq -r '.data[0].gid' response.json)
|
|
28
|
+
echo "TASK_GID=$TASK_GID" >> $GITHUB_ENV
|
|
29
|
+
- name: Comment on Asana Task
|
|
30
|
+
env:
|
|
31
|
+
ISSUE_COMMENT: ${{ github.event.comment.body }}
|
|
32
|
+
COMMENTER_NAME: ${{ github.event.comment.user.login }}
|
|
33
|
+
run: |
|
|
34
|
+
BODY_DATA=$(jq -n \
|
|
35
|
+
--arg text "$ISSUE_COMMENT" \
|
|
36
|
+
--arg commenter_name "$COMMENTER_NAME" \
|
|
37
|
+
'{
|
|
38
|
+
"data": {
|
|
39
|
+
"text": "\($commenter_name) left a comment:\n\n\($text)",
|
|
40
|
+
}
|
|
41
|
+
}')
|
|
42
|
+
curl --request POST \
|
|
43
|
+
--url https://app.asana.com/api/1.0/tasks/$TASK_GID/stories \
|
|
44
|
+
--header 'accept: application/json' \
|
|
45
|
+
--header 'authorization: Bearer ${{ secrets.ASANA_PAT }}' \
|
|
46
|
+
--header 'content-type: application/json' \
|
|
47
|
+
--data "$BODY_DATA"
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
name: Github --> Asana Create Task Workflow
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issues:
|
|
5
|
+
types: [opened]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
issues: read
|
|
13
|
+
steps:
|
|
14
|
+
- name: Create Asana task
|
|
15
|
+
env:
|
|
16
|
+
ISSUE_TITLE: ${{ github.event.issue.title }}
|
|
17
|
+
ISSUE_BODY: ${{ github.event.issue.body }}
|
|
18
|
+
ISSUE_HTML_URL: ${{ github.event.issue.html_url }}
|
|
19
|
+
ISSUE_ID: ${{ github.event.issue.id }}
|
|
20
|
+
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
|
21
|
+
REPO_FULL_NAME: ${{ github.event.repository.full_name }}
|
|
22
|
+
SDK_PLATFORM_GROUP: "1208961704779581"
|
|
23
|
+
SDK_PLATFORM_GROUP_SERVER: "1208961704779585"
|
|
24
|
+
SDK_PLATFORM: "1208961704779592"
|
|
25
|
+
SDK_PLATFORM_TYPESCRIPT: "1208961704779609"
|
|
26
|
+
DSA_PRIORITY: "1208779519954980"
|
|
27
|
+
DSA_PRIORITY_NO_PRIORITY: "1208779521616959"
|
|
28
|
+
DSA_STATUS: "1210103546117753"
|
|
29
|
+
DSA_STATUS_TRIAGE: "1210103546117756"
|
|
30
|
+
DSA_REPO_TICKET_URL: "1210347857768758"
|
|
31
|
+
WORKSPACE_ID: "780103692902078"
|
|
32
|
+
PROJECT_ID_GITHUB_AND_IMPORTANT_SDK_ISSUES: "1208970714650308"
|
|
33
|
+
PROJECT_ID_SDK_BACKLOG: "1208777198342772"
|
|
34
|
+
run: |
|
|
35
|
+
DATA_BODY=$(jq -n \
|
|
36
|
+
--arg title "$ISSUE_TITLE" \
|
|
37
|
+
--arg body "$ISSUE_BODY" \
|
|
38
|
+
--arg url "$ISSUE_HTML_URL" \
|
|
39
|
+
--arg id "$ISSUE_ID" \
|
|
40
|
+
--arg number "$ISSUE_NUMBER" \
|
|
41
|
+
--arg repo_full_name "$REPO_FULL_NAME" \
|
|
42
|
+
--arg sdk_platform_group "$SDK_PLATFORM_GROUP" \
|
|
43
|
+
--arg sdk_platform_group_server "$SDK_PLATFORM_GROUP_SERVER" \
|
|
44
|
+
--arg sdk_platform "$SDK_PLATFORM" \
|
|
45
|
+
--arg sdk_platform_typescript "$SDK_PLATFORM_TYPESCRIPT" \
|
|
46
|
+
--arg dsa_priority "$DSA_PRIORITY" \
|
|
47
|
+
--arg dsa_priority_no_priority "$DSA_PRIORITY_NO_PRIORITY" \
|
|
48
|
+
--arg dsa_status "$DSA_STATUS" \
|
|
49
|
+
--arg dsa_status_triage "$DSA_STATUS_TRIAGE" \
|
|
50
|
+
--arg dsa_repo_ticket_url "$DSA_REPO_TICKET_URL" \
|
|
51
|
+
--arg workspace_id "$WORKSPACE_ID" \
|
|
52
|
+
--arg project_id_github_and_important_sdk_issues "$PROJECT_ID_GITHUB_AND_IMPORTANT_SDK_ISSUES" \
|
|
53
|
+
--arg project_id_sdk_backlog "$PROJECT_ID_SDK_BACKLOG" \
|
|
54
|
+
'{
|
|
55
|
+
"data": {
|
|
56
|
+
"custom_fields": {
|
|
57
|
+
$sdk_platform_group: $sdk_platform_group_server,
|
|
58
|
+
$sdk_platform: $sdk_platform_typescript,
|
|
59
|
+
$dsa_priority: $dsa_priority_no_priority,
|
|
60
|
+
$dsa_status: $dsa_status_triage,
|
|
61
|
+
$dsa_repo_ticket_url: $url
|
|
62
|
+
},
|
|
63
|
+
"name": $title,
|
|
64
|
+
"workspace": $workspace_id,
|
|
65
|
+
"projects": [$project_id_github_and_important_sdk_issues, $project_id_sdk_backlog],
|
|
66
|
+
"notes": "Issue ID: \($repo_full_name)#\($id)\nIssue number: \($number)\nCreated via GitHub Actions\n----\n\n\($body)"
|
|
67
|
+
}
|
|
68
|
+
}')
|
|
69
|
+
|
|
70
|
+
curl --request POST \
|
|
71
|
+
--url https://app.asana.com/api/1.0/tasks?opt_pretty=true \
|
|
72
|
+
--header 'accept: application/json' \
|
|
73
|
+
--header 'authorization: Bearer ${{ secrets.ASANA_PAT }}' \
|
|
74
|
+
--header 'content-type: application/json' \
|
|
75
|
+
--data "$DATA_BODY" \
|
|
76
|
+
--output response.json
|
|
77
|
+
|
|
78
|
+
TASK_GID=$(jq -r '.data.gid' response.json)
|
|
79
|
+
echo "TASK_GID=$TASK_GID" >> $GITHUB_ENV
|
|
80
|
+
- name: Move to "0 Unclassified" section in "Github & Important SDK Issues" project
|
|
81
|
+
env:
|
|
82
|
+
SECTION_ID_GITHUB_AND_IMPORTANT_SDK_ISSUES: "1208970755434051"
|
|
83
|
+
run: |
|
|
84
|
+
DATA_BODY=$(jq -n \
|
|
85
|
+
--arg task_gid "$TASK_GID" \
|
|
86
|
+
--arg section_id "$SECTION_ID_GITHUB_AND_IMPORTANT_SDK_ISSUES" \
|
|
87
|
+
'{
|
|
88
|
+
"data": {
|
|
89
|
+
"task": $task_gid,
|
|
90
|
+
"insert_after": "null"
|
|
91
|
+
}
|
|
92
|
+
}')
|
|
93
|
+
|
|
94
|
+
curl --request POST \
|
|
95
|
+
--url https://app.asana.com/api/1.0/sections/$section_id/addTask \
|
|
96
|
+
--header 'accept: application/json' \
|
|
97
|
+
--header 'authorization: Bearer ${{ secrets.ASANA_PAT }}' \
|
|
98
|
+
--header 'content-type: application/json' \
|
|
99
|
+
--data "$DATA_BODY"
|
|
100
|
+
- name: Move to "Untriaged" section in "SDK / Backlog" project
|
|
101
|
+
env:
|
|
102
|
+
SECTION_ID_SDK_BACKLOG: "1208899729378982"
|
|
103
|
+
run: |
|
|
104
|
+
DATA_BODY=$(jq -n \
|
|
105
|
+
--arg task_gid "$TASK_GID" \
|
|
106
|
+
--arg section_id "$SECTION_ID_SDK_BACKLOG" \
|
|
107
|
+
'{
|
|
108
|
+
"data": {
|
|
109
|
+
"task": $task_gid,
|
|
110
|
+
"insert_after": "null"
|
|
111
|
+
}
|
|
112
|
+
}')
|
|
113
|
+
|
|
114
|
+
curl --request POST \
|
|
115
|
+
--url https://app.asana.com/api/1.0/sections/$section_id/addTask \
|
|
116
|
+
--header 'accept: application/json' \
|
|
117
|
+
--header 'authorization: Bearer ${{ secrets.ASANA_PAT }}' \
|
|
118
|
+
--header 'content-type: application/json' \
|
|
119
|
+
--data "$DATA_BODY"
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
name: Github --> Asana Issue Updates Workflow
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issues:
|
|
5
|
+
types: [edited, deleted, closed, reopened, assigned, unassigned, labeled, unlabeled, milestoned, demilestoned, pinned, unpinned, locked, unlocked, transferred]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
issues: read
|
|
13
|
+
steps:
|
|
14
|
+
- name: Get Asana Task Corresponding to Issue
|
|
15
|
+
env:
|
|
16
|
+
ISSUE_ID: ${{ github.event.issue.id }}
|
|
17
|
+
REPO_FULL_NAME: ${{ github.event.repository.full_name }}
|
|
18
|
+
WORKSPACE_ID: "780103692902078"
|
|
19
|
+
run: |
|
|
20
|
+
REPO_SCOPED_ISSUE_ID="$REPO_FULL_NAME#$ISSUE_ID"
|
|
21
|
+
|
|
22
|
+
curl --request GET \
|
|
23
|
+
--url "https://app.asana.com/api/1.0/workspaces/$WORKSPACE_ID/tasks/search?opt_fields=notes&text=$REPO_SCOPED_ISSUE_ID&sort_by=modified_at&sort_ascending=false" \
|
|
24
|
+
--header 'accept: application/json' \
|
|
25
|
+
--header 'authorization: Bearer ${{ secrets.ASANA_PAT }}' \
|
|
26
|
+
--output response.json
|
|
27
|
+
TASK_GID=$(jq -r '.data[0].gid' response.json)
|
|
28
|
+
echo "TASK_GID=$TASK_GID" >> $GITHUB_ENV
|
|
29
|
+
- name: Determine Action and Post to Asana
|
|
30
|
+
env:
|
|
31
|
+
ACTION_TYPE: ${{ github.event.action }}
|
|
32
|
+
ACTOR_NAME: ${{ github.event.sender.login }}
|
|
33
|
+
ISSUE_TITLE: ${{ github.event.issue.title }}
|
|
34
|
+
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
|
35
|
+
ISSUE_STATE: ${{ github.event.issue.state }}
|
|
36
|
+
run: |
|
|
37
|
+
# Map GitHub action types to human-readable descriptions
|
|
38
|
+
case "$ACTION_TYPE" in
|
|
39
|
+
"edited")
|
|
40
|
+
ACTION_DESC="edited the issue"
|
|
41
|
+
;;
|
|
42
|
+
"deleted")
|
|
43
|
+
ACTION_DESC="deleted the issue"
|
|
44
|
+
;;
|
|
45
|
+
"closed")
|
|
46
|
+
ACTION_DESC="closed the issue"
|
|
47
|
+
;;
|
|
48
|
+
"reopened")
|
|
49
|
+
ACTION_DESC="reopened the issue"
|
|
50
|
+
;;
|
|
51
|
+
"assigned")
|
|
52
|
+
ACTION_DESC="assigned the issue"
|
|
53
|
+
;;
|
|
54
|
+
"unassigned")
|
|
55
|
+
ACTION_DESC="unassigned the issue"
|
|
56
|
+
;;
|
|
57
|
+
"labeled")
|
|
58
|
+
ACTION_DESC="added labels to the issue"
|
|
59
|
+
;;
|
|
60
|
+
"unlabeled")
|
|
61
|
+
ACTION_DESC="removed labels from the issue"
|
|
62
|
+
;;
|
|
63
|
+
"milestoned")
|
|
64
|
+
ACTION_DESC="added the issue to a milestone"
|
|
65
|
+
;;
|
|
66
|
+
"demilestoned")
|
|
67
|
+
ACTION_DESC="removed the issue from a milestone"
|
|
68
|
+
;;
|
|
69
|
+
"pinned")
|
|
70
|
+
ACTION_DESC="pinned the issue"
|
|
71
|
+
;;
|
|
72
|
+
"unpinned")
|
|
73
|
+
ACTION_DESC="unpinned the issue"
|
|
74
|
+
;;
|
|
75
|
+
"locked")
|
|
76
|
+
ACTION_DESC="locked the issue"
|
|
77
|
+
;;
|
|
78
|
+
"unlocked")
|
|
79
|
+
ACTION_DESC="unlocked the issue"
|
|
80
|
+
;;
|
|
81
|
+
"transferred")
|
|
82
|
+
ACTION_DESC="transferred the issue"
|
|
83
|
+
;;
|
|
84
|
+
*)
|
|
85
|
+
ACTION_DESC="performed an action on the issue"
|
|
86
|
+
;;
|
|
87
|
+
esac
|
|
88
|
+
|
|
89
|
+
# Add additional context for specific actions based on webhook payload
|
|
90
|
+
if [ "$ACTION_TYPE" = "assigned" ] && [ -n "${{ github.event.assignee.login }}" ]; then
|
|
91
|
+
ACTION_DESC="assigned the issue to ${{ github.event.assignee.login }}"
|
|
92
|
+
fi
|
|
93
|
+
|
|
94
|
+
if [ "$ACTION_TYPE" = "unassigned" ] && [ -n "${{ github.event.assignee.login }}" ]; then
|
|
95
|
+
ACTION_DESC="unassigned the issue from ${{ github.event.assignee.login }}"
|
|
96
|
+
fi
|
|
97
|
+
|
|
98
|
+
if [ "$ACTION_TYPE" = "labeled" ] && [ -n "${{ github.event.label.name }}" ]; then
|
|
99
|
+
LABEL_COLOR="${{ github.event.label.color }}"
|
|
100
|
+
ACTION_DESC="added label '${{ github.event.label.name }}' to the issue"
|
|
101
|
+
if [ -n "$LABEL_COLOR" ]; then
|
|
102
|
+
ACTION_DESC="$ACTION_DESC (color: #$LABEL_COLOR)"
|
|
103
|
+
fi
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
if [ "$ACTION_TYPE" = "unlabeled" ] && [ -n "${{ github.event.label.name }}" ]; then
|
|
107
|
+
LABEL_COLOR="${{ github.event.label.color }}"
|
|
108
|
+
ACTION_DESC="removed label '${{ github.event.label.name }}' from the issue"
|
|
109
|
+
if [ -n "$LABEL_COLOR" ]; then
|
|
110
|
+
ACTION_DESC="$ACTION_DESC (color: #$LABEL_COLOR)"
|
|
111
|
+
fi
|
|
112
|
+
fi
|
|
113
|
+
|
|
114
|
+
if [ "$ACTION_TYPE" = "milestoned" ] && [ -n "${{ github.event.milestone.title }}" ]; then
|
|
115
|
+
MILESTONE_DUE_DATE="${{ github.event.milestone.due_on }}"
|
|
116
|
+
ACTION_DESC="added the issue to milestone '${{ github.event.milestone.title }}'"
|
|
117
|
+
if [ -n "$MILESTONE_DUE_DATE" ] && [ "$MILESTONE_DUE_DATE" != "null" ]; then
|
|
118
|
+
ACTION_DESC="$ACTION_DESC (due: $MILESTONE_DUE_DATE)"
|
|
119
|
+
fi
|
|
120
|
+
fi
|
|
121
|
+
|
|
122
|
+
if [ "$ACTION_TYPE" = "demilestoned" ] && [ -n "${{ github.event.milestone.title }}" ]; then
|
|
123
|
+
ACTION_DESC="removed the issue from milestone '${{ github.event.milestone.title }}'"
|
|
124
|
+
fi
|
|
125
|
+
|
|
126
|
+
if [ "$ACTION_TYPE" = "transferred" ] && [ -n "${{ github.event.changes.new_repository.full_name }}" ]; then
|
|
127
|
+
ACTION_DESC="transferred the issue to repository ${{ github.event.changes.new_repository.full_name }}"
|
|
128
|
+
fi
|
|
129
|
+
|
|
130
|
+
if [ "$ACTION_TYPE" = "edited" ] && [ -n "${{ github.event.changes.title.from }}" ]; then
|
|
131
|
+
OLD_TITLE="${{ github.event.changes.title.from }}"
|
|
132
|
+
NEW_TITLE="${{ github.event.issue.title }}"
|
|
133
|
+
ACTION_DESC="edited the issue title from '$OLD_TITLE' to '$NEW_TITLE'"
|
|
134
|
+
fi
|
|
135
|
+
|
|
136
|
+
echo "ACTION_DESC=$ACTION_DESC" >> $GITHUB_ENV
|
|
137
|
+
|
|
138
|
+
# Only proceed if we found a task
|
|
139
|
+
if [ "$TASK_GID" != "null" ] && [ -n "$TASK_GID" ]; then
|
|
140
|
+
# Create a more detailed message with additional context
|
|
141
|
+
MESSAGE_TEXT="$ACTOR_NAME performed an action: $ACTION_DESC"
|
|
142
|
+
|
|
143
|
+
# Add issue state information for state changes
|
|
144
|
+
if [ "$ACTION_TYPE" = "closed" ] || [ "$ACTION_TYPE" = "reopened" ]; then
|
|
145
|
+
MESSAGE_TEXT=$(printf "%s\nIssue state: %s" "$MESSAGE_TEXT" "$ISSUE_STATE")
|
|
146
|
+
fi
|
|
147
|
+
|
|
148
|
+
# Add repository information for transferred issues
|
|
149
|
+
if [ "$ACTION_TYPE" = "transferred" ]; then
|
|
150
|
+
REPO_NAME="${{ github.event.repository.full_name }}"
|
|
151
|
+
MESSAGE_TEXT=$(printf "%s\nFrom repository: %s" "$MESSAGE_TEXT" "$REPO_NAME")
|
|
152
|
+
fi
|
|
153
|
+
|
|
154
|
+
MESSAGE_TEXT=$(printf "%s\n\nIssue: #%s - %s" "$MESSAGE_TEXT" "$ISSUE_NUMBER" "$ISSUE_TITLE")
|
|
155
|
+
|
|
156
|
+
BODY_DATA=$(jq -n \
|
|
157
|
+
--arg text "$MESSAGE_TEXT" \
|
|
158
|
+
'{
|
|
159
|
+
"data": {
|
|
160
|
+
"text": $text
|
|
161
|
+
}
|
|
162
|
+
}')
|
|
163
|
+
|
|
164
|
+
curl --request POST \
|
|
165
|
+
--url https://app.asana.com/api/1.0/tasks/$TASK_GID/stories \
|
|
166
|
+
--header 'accept: application/json' \
|
|
167
|
+
--header 'authorization: Bearer ${{ secrets.ASANA_PAT }}' \
|
|
168
|
+
--header 'content-type: application/json' \
|
|
169
|
+
--data "$BODY_DATA"
|
|
170
|
+
else
|
|
171
|
+
echo "No corresponding Asana task found for issue ID: $ISSUE_ID"
|
|
172
|
+
fi
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: Add issues to project
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issues:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
add-to-project:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Add issue to project
|
|
13
|
+
uses: actions/add-to-project@v1.0.2
|
|
14
|
+
with:
|
|
15
|
+
# SDK Server Project
|
|
16
|
+
project-url: https://github.com/orgs/OneSignal/projects/11
|
|
17
|
+
github-token: ${{ secrets.GH_PROJECTS_TOKEN }}
|
package/DefaultApi.md
CHANGED
|
@@ -296,7 +296,7 @@ Name | Type | Description | Notes
|
|
|
296
296
|
|
|
297
297
|
### Authorization
|
|
298
298
|
|
|
299
|
-
[
|
|
299
|
+
[organization_api_key](README.md#organization_api_key)
|
|
300
300
|
|
|
301
301
|
### HTTP request headers
|
|
302
302
|
|
|
@@ -1167,7 +1167,7 @@ Name | Type | Description | Notes
|
|
|
1167
1167
|
|
|
1168
1168
|
### Authorization
|
|
1169
1169
|
|
|
1170
|
-
[
|
|
1170
|
+
[organization_api_key](README.md#organization_api_key)
|
|
1171
1171
|
|
|
1172
1172
|
### HTTP request headers
|
|
1173
1173
|
|
|
@@ -1217,7 +1217,7 @@ This endpoint does not need any parameter.
|
|
|
1217
1217
|
|
|
1218
1218
|
### Authorization
|
|
1219
1219
|
|
|
1220
|
-
[
|
|
1220
|
+
[organization_api_key](README.md#organization_api_key)
|
|
1221
1221
|
|
|
1222
1222
|
### HTTP request headers
|
|
1223
1223
|
|
|
@@ -1813,7 +1813,7 @@ Name | Type | Description | Notes
|
|
|
1813
1813
|
|
|
1814
1814
|
### Authorization
|
|
1815
1815
|
|
|
1816
|
-
[
|
|
1816
|
+
[organization_api_key](README.md#organization_api_key)
|
|
1817
1817
|
|
|
1818
1818
|
### HTTP request headers
|
|
1819
1819
|
|
package/README.md
CHANGED
|
@@ -61,8 +61,8 @@ You can configure auth parameters passing them like this:
|
|
|
61
61
|
|
|
62
62
|
```js
|
|
63
63
|
const configuration = OneSignal.createConfiguration({
|
|
64
|
-
|
|
65
|
-
restApiKey: '<YOUR_REST_API_KEY>',
|
|
64
|
+
organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>', // Organization key is only required for creating new apps and other top-level endpoints
|
|
65
|
+
restApiKey: '<YOUR_REST_API_KEY>', // App REST API key required for most endpoints
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
const client = new OneSignal.DefaultApi(configuration);
|
|
@@ -76,7 +76,7 @@ parameter. You can then use this to modify your configuration object and create
|
|
|
76
76
|
const response = await client.createApp(newapp);
|
|
77
77
|
|
|
78
78
|
const configuration = OneSignal.createConfiguration({
|
|
79
|
-
|
|
79
|
+
organizationApiKey: '<YOUR_ORGANIZATION_API_KEY>', // Organization key is only required for creating new apps and other top-level endpoints
|
|
80
80
|
restApiKey: response.basic_auth_key,
|
|
81
81
|
});
|
|
82
82
|
|
|
@@ -86,14 +86,14 @@ const client = new OneSignal.DefaultApi(configuration);
|
|
|
86
86
|
---
|
|
87
87
|
## API Reference
|
|
88
88
|
|
|
89
|
-
> See the full list of [API Endpoints](DefaultApi.
|
|
89
|
+
> See the full list of [API Endpoints](DefaultApi.MD).
|
|
90
90
|
|
|
91
91
|
To make stateful changes requests should take on the following pattern:
|
|
92
92
|
1. create or get an object
|
|
93
93
|
2. make changes to that object
|
|
94
94
|
3. pass the object to the request function to make the changes
|
|
95
95
|
|
|
96
|
-
Examples of important OneSignal objects include `App`, `Notification`, `
|
|
96
|
+
Examples of important OneSignal objects include `App`, `Notification`, `Player`, and `Segment`.
|
|
97
97
|
|
|
98
98
|
For example, see the section below on creating an app. First an app object is created via the instantiation of the `App`
|
|
99
99
|
class. Then, the app instance is modified directly. Finally, we use the `client` to create the app via a remote request.
|
|
@@ -586,4 +586,4 @@ Give a ⭐️ if this project helped you!
|
|
|
586
586
|
|
|
587
587
|
Copyright © 2023 [OneSignal](https://github.com/OneSignal).
|
|
588
588
|
|
|
589
|
-
This project is [MIT](https://github.com/OneSignal/node-onesignal/blob/main/LICENSE) licensed.
|
|
589
|
+
This project is [MIT](https://github.com/OneSignal/node-onesignal/blob/main/LICENSE) licensed.
|